Re: scripts in Postgres - Mailing list pgsql-general

From Rolf Østvik
Subject Re: scripts in Postgres
Date
Msg-id Xns964B59DC9D060rolfostvikjobbyahoon@200.46.204.72
Whole thread Raw
In response to scripts in Postgres  ("Craig Bryden" <postgresql@bryden.co.za>)
Responses Re: scripts in Postgres
List pgsql-general
postgresql@bryden.co.za ("Craig Bryden") wrote in
news:001601c54f15$b9d32fe0$0200a8c0@amd2800:

> Hi Sean
>
> Thanks for that. Does psql work differently to pgAmin III's Query
> program? I have tried exactly what you showed me below, and it did not
> work. It seems like the script stops on first error, and the first
> error is that the table does not exist.
>

Could it be that it pgAdmin creates a transaction.
What happens if you set in some begin and commit.
(Just a wild suggestion, not tested in any way).
----------------------------------------
begin;
DROP TABLE tb_messages;
commit;
begin;
CREATE TABLE tb_messages (
....
);
commit;

--
Rolf

pgsql-general by date:

Previous
From: "Dinesh Pandey"
Date:
Subject: Re: unable to open editor.
Next
From: Richard Huxton
Date:
Subject: Re: Tuning queries inside a function