On 11/01/2014 12:13 PM, Peter Eisentraut wrote:
> On 10/15/14 5:58 PM, Jonathan Rogers wrote:
>> BTW, I would rewrite the 9.1 example to be shorter while
>> behaving the same:
>>
>>
>> CREATE FUNCTION usesavedplan() RETURNS trigger AS $$
>> plan = SD.get("plan")
>> if plan is None:
>
> If
On 10/15/14 5:58 PM, Jonathan Rogers wrote:
> BTW, I would rewrite the 9.1 example to be shorter while
> behaving the same:
>
>
> CREATE FUNCTION usesavedplan() RETURNS trigger AS $$
> plan = SD.get("plan")
> if plan is None:
If we're going for shortness, how about
if not plan:
?
On 10/15/14 5:56 PM, Tom Lane wrote:
> Hm ... this was changed in commit 6f6b46c9c0ca3d96. Peter, did
> you consider efficiency here?
Fixed.
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-ge
On 10/15/2014 05:51 PM, Adrian Klaver wrote:
> On 10/15/2014 02:39 PM, Jonathan Rogers wrote:
>> I was just reading the PL/Python docs section "42.7.1 Database Access
>> Functions" and saw this example:
>>
>> CREATE FUNCTION usesavedplan() RETURNS trigger AS $$
>> plan = SD.setdefault("plan",
Adrian Klaver writes:
> On 10/15/2014 02:39 PM, Jonathan Rogers wrote:
>> I was just reading the PL/Python docs section "42.7.1 Database Access
>> Functions" and saw this example:
>>
>> CREATE FUNCTION usesavedplan() RETURNS trigger AS $$
>> plan = SD.setdefault("plan", plpy.prepare("SELECT 1"))
On 10/15/2014 02:39 PM, Jonathan Rogers wrote:
I was just reading the PL/Python docs section "42.7.1 Database Access
Functions" and saw this example:
CREATE FUNCTION usesavedplan() RETURNS trigger AS $$
plan = SD.setdefault("plan", plpy.prepare("SELECT 1"))
# rest of function
$$ LANGUA
I was just reading the PL/Python docs section "42.7.1 Database Access
Functions" and saw this example:
CREATE FUNCTION usesavedplan() RETURNS trigger AS $$
plan = SD.setdefault("plan", plpy.prepare("SELECT 1"))
# rest of function
$$ LANGUAGE plpythonu;
The above example uses the plpy.prep