Re: psql metaqueries with \gexec - Mailing list pgsql-hackers

From Tom Lane
Subject Re: psql metaqueries with \gexec
Date
Msg-id 13096.1459725126@sss.pgh.pa.us
Whole thread Raw
In response to Re: psql metaqueries with \gexec  (Corey Huinker <corey.huinker@gmail.com>)
Responses Re: psql metaqueries with \gexec  (Corey Huinker <corey.huinker@gmail.com>)
List pgsql-hackers
Corey Huinker <corey.huinker@gmail.com> writes:
> On Sun, Apr 3, 2016 at 4:26 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I'm not Jim, but I have a question: what's the motivation for the
>> Fortran-order traversal of the result (down rows before across columns)?

> If I am understanding you correctly, it does work the way you find
> intuitive: all results from the first row are executed before any in the
> second row, so

Oh, I hadn't checked the code closely enough to realize that, but I see
you're right.  The patch's documentation seems very confusing on the
point, though:

+         The secondary queries are executed in top-to-bottom, left-to-right order, so the command

I took that as meaning what I said above.

>> It should clear that in all the same
>> places where gfname or gset_prefix get cleared.

> I'm only seeing one place where those two vars are deallocated and nulled,
> and that's at the tail end of SendQuery. Were you expecting more than just
> that?

That may be the only place; I've not looked around.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Using quicksort for every external sort run
Next
From: Dave Cramer
Date:
Subject: Re: Proposal: RETURNING primary_key()