Although this is probably a "feature", it is a weird one:
fabien=# SELECT 1 AS one \;
fabien-# SELECT 2 AS two ;
Where is my "1"?
Although "\;" behavior is not documented, I would have expected both
results to be shown one after the other, or having a an error, but not a
My guess is that psql uses PQexec which just returns the last result.
Using PQsendQuery/PQgetResult would result in a much better behavior.
fabien=# CREATE TABLE foo(id TEXT);
fabien=# INSERT INTO foo VALUES('calvin') \;
fabien-# INSERT INTO foo VALUES('hobbes') ;
INSERT 0 1
fabien=# SELECT * FROM foo;
I would suggest that:
- the \; psql feature should be documented somewhere
- all results should be shown, not just the last one
Sent via pgsql-hackers mailing list (firstname.lastname@example.org)
To make changes to your subscription: