Hello devs,

Although this is probably a "feature", it is a weird one:

 $ psql
 psql (9.6beta2)
 fabien=# SELECT 1 AS one \;
 fabien-# SELECT 2 AS two ;
  two
 -----
    2
 (1 row)

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 quiet discard.

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);
 CREATE TABLE
 fabien=# INSERT INTO foo VALUES('calvin') \;
 fabien-# INSERT INTO foo VALUES('hobbes') ;
 INSERT 0 1
 fabien=# SELECT * FROM foo;
    id
 --------
  calvin
  hobbes
 (2 rows)

I would suggest that:
 - the \; psql feature should be documented somewhere
 - all results should be shown, not just the last one

Any opinion?

--
Fabien.


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to