Hello Robert,

I agree: I like \into.

Great!

But:

SELECT 1, 2 \; SELECT 3;
 \into one two three

I think that's pretty weird.

I agree that it is weird, but I do not think that it is bad.

Sending a batch of requests is a feature of libpq which is accessible through pgbench by using "\;", although the fact is not documented. It makes sense for a client to send independent queries together so as to reduce latency.

From pgbench perspective, I would find it pretty weird as well that one
can send several queries together but could only read the answer from... say the first one, and the others would be lost.

From an implementation perspective doing it is straightforward, and
rejecting it would require some more logic.

An obvious nicer feature would be to allow intermixing \into & \; but ISTM that it would require to rethink deeply pgbench lexing/parsing which has just been merged with psql by Tom and others...

If I had not pointed out the fact that it works, maybe no one would have noticed... so a compromise could be not to advertise the fact that it works (as the \; feature is not advertised anyway), but letting the implementation do it because it is simple and may be useful, and rephrase the documentation so that it is just about the previous select and not previous select*S*?

--
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