Re: [HACKERS] [GENERAL] Extracting time from timestamp

2003-03-23 Thread Chris Gamache
Why not a cast? template1=# select current_timestamp::time; time - 11:24:22.004207 (1 row) template1=# select current_timestamp::time(0); time -- 11:24:26 (1 row) --- Christopher Kings-Lynne <[EMAIL PROTECTED]> wrote: > > phd=# select time(abstime(timestamp 'n

Re: Fwd: Re: [HACKERS] [GENERAL] Extracting time from timestamp

2003-03-20 Thread Shridhar Daithankar<[EMAIL PROTECTED]>
On Friday 21 Mar 2003 12:25 pm, Tom Lane wrote: > "Shridhar Daithankar<[EMAIL PROTECTED]>" <[EMAIL PROTECTED]> writes: > > And What's so holy about "" if it is a function? > > The problem is that TIME(n) is a datatype name, not a function call, > according to the SQL spec. Likewise for TIMESTAMP(

Re: Fwd: Re: [HACKERS] [GENERAL] Extracting time from timestamp

2003-03-20 Thread Tom Lane
"Shridhar Daithankar<[EMAIL PROTECTED]>" <[EMAIL PROTECTED]> writes: > And What's so holy about "" if it is a function? The problem is that TIME(n) is a datatype name, not a function call, according to the SQL spec. Likewise for TIMESTAMP(n), INTERVAL(n), NUMERIC(m,n), and maybe one or two other

Re: [HACKERS] [GENERAL] Extracting time from timestamp

2003-03-20 Thread Christopher Kings-Lynne
> > select "time"(abstime(timestamp 'now')) from bookings; > > select "time"(timestamp 'now') from bookings; > > First of all, thanks, it worked.. > > And What's so holy about "" if it is a function? It's really old 7.1 syntax, not supported from 7.2+. Basically it's because time can now have a

Fwd: Re: [HACKERS] [GENERAL] Extracting time from timestamp

2003-03-20 Thread Shridhar Daithankar<[EMAIL PROTECTED]>
On Friday 21 Mar 2003 11:38 am, Christopher Kings-Lynne wrote: > > phd=# select time(abstime(timestamp 'now')) from bookings; > > ERROR: parser: parse error at or near "abstime" at character 13 > > phd=# select time(timestamp 'now') from bookings; > > ERROR: parser: parse error at or near "timest