Re: pg_execute_from_file review - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: pg_execute_from_file review
Date
Msg-id m2y68guxsy.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Re: pg_execute_from_file review  (Joshua Tolley <eggyknap@gmail.com>)
List pgsql-hackers
Joshua Tolley <eggyknap@gmail.com> writes:
>> > * I'd like to see the docs slightly expanded, specifically to describe
>> >   parameter replacement. I wondered for a while if I needed to set of
>> >   parameters in any specific way, before reading the code and realizing they
>> >   can be whatever I want.
>> 
>> My guess is that you knew that in the CREATE EXTENSION context, it has
>> been proposed to use the notation @extschema@ as a placeholder, and
>> you've then been confused. I've refrained from imposing any style with
>> respect to what the placeholder would look like in the mecanism-patch.
>> 
>> Do we still want to detail in the docs that there's nothing expected
>> about the placeholder syntax of format?
>
> Perhaps such docs will show up with the rest of the EXTENSION work, but I'd
> like a brief mention somewhere.

I'm unclear about how to spell out what you'd like to be seen in there,
so I'm not proposing a newer version of the patch.

>> > * Shouldn't it include SPI_push() and SPI_pop()?
>> 
>> ENOCLUE
>
> My guess is "yes", because that was widely hailed as a good idea when I did
> PL/LOLCODE. I suspect it would only matter if someone were using
> pg_execute_from_file within some other function, which isn't entirely
> unlikely.

In fact, per the fine manual, it seems unnecessary doing so when using
SPI_execute(), which is the case here:
 http://www.postgresql.org/docs/9.0/interactive/spi-spi-push.html
 Note that SPI_execute and related functions automatically do the equivalent of SPI_push before passing control back to
theSQL execution engine, so it is not necessary for you to worry about this when using those functions.
 

For information, we've been talking about the case on IRC and Joshua and
we are agreeing on this conclusion.

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: memory leak in libxml2 - fix
Next
From: Robert Haas
Date:
Subject: Re: contrib: auth_delay module