Re: [GENERAL] PL/Python prepare example's use of setdefault

2014-11-01 Thread Jonathan Rogers
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

Re: [GENERAL] Converting char to varchar automatically

2014-11-01 Thread Andrus
Hi! That looks sane, though you didn't need the WITH. I changed select to code below. If same table name appears in multiple schemas, it generates duplicate alter column clauses which cause error. How to fix it to generate proper sql ? I added n.nspname='myschame' as shown in code below but

Re: [GENERAL] PL/Python prepare example's use of setdefault

2014-11-01 Thread Peter Eisentraut
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: ?

Re: [GENERAL] PL/Python prepare example's use of setdefault

2014-11-01 Thread Peter Eisentraut
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

Re: [GENERAL] Retrieving Data from table based on Date and Time.

2014-11-01 Thread VENKTESH GUTTEDAR
Thanks it helped. On Sat, Nov 1, 2014 at 2:09 PM, Stephen Cook wrote: > On 11/1/2014 2:27 AM, VENKTESH GUTTEDAR wrote: > >> I have a table in which i have some few fields, in that few, one >> field is of date type and second one is of time data type, so now my >> question is how can i fetch

Re: [GENERAL] Retrieving Data from table based on Date and Time.

2014-11-01 Thread Stephen Cook
On 11/1/2014 2:27 AM, VENKTESH GUTTEDAR wrote: I have a table in which i have some few fields, in that few, one field is of date type and second one is of time data type, so now my question is how can i fetch the data with latest date and time, or the last inserted value from the PostgreSQL