Re: [GENERAL] Syntax for converting double to a timestamp

2006-09-05 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Frank Church wrote: > On 9/5/06, codeWarrior <[EMAIL PROTECTED]> wrote: >> It's generally considered bad form to use reserved words as column >> names >> > > I am aware of that - in this case the column names are chosen to > reflect exactly the n

Re: [GENERAL] Syntax for converting double to a timestamp

2006-09-05 Thread Frank Church
On 9/5/06, codeWarrior <[EMAIL PROTECTED]> wrote: It's generally considered bad form to use reserved words as column names I am aware of that - in this case the column names are chosen to reflect exactly the names of the attributes of the event being recorded. ""Frank Church"" <[EM

Re: [GENERAL] Syntax for converting double to a timestamp

2006-09-05 Thread codeWarrior
It's generally considered bad form to use reserved words as column names ""Frank Church"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I am trying to create a view based on this query > > 'select *, "timestamp"::timestamp from ccmanager_log' > > > This is the error I get to

Re: [GENERAL] Syntax for converting double to a timestamp

2006-09-04 Thread Frank Church
On 9/4/06, Alban Hertroys <[EMAIL PROTECTED]> wrote: Michael Glaesemann wrote: > Note that epoch does not mean 1900-01-01 00:00:00. select *, timestamp 'EPOCH' + "timestamp" * interval '1 second' as tstamp from ccmanager_log where id > 15400 select *, timestamp '1900-01-01 00:00:00' + "times

Re: [GENERAL] Syntax for converting double to a timestamp

2006-09-04 Thread Alban Hertroys
Michael Glaesemann wrote: Note that epoch does not mean 1900-01-01 00:00:00. Indeed! Where did this 1900 sneak in? Aren't timestamps usually based on epoch? -- Alban Hertroys [EMAIL PROTECTED] magproductions b.v. T: ++31(0)534346874 F: ++31(0)534346876 M: I: www.magproductions.nl A: Postbu

Re: [GENERAL] Syntax for converting double to a timestamp

2006-09-04 Thread Michael Glaesemann
On Sep 4, 2006, at 17:58 , Alban Hertroys wrote: Peter Eisentraut wrote: It's not clear what the meaning of a double precision as a timestamp would be. How about you make that explicit: "timestamp" * interval '1 second' + timestamp '1900-01-01 00:00:00' There's also 'EPOCH', which is shor

Re: [GENERAL] Syntax for converting double to a timestamp

2006-09-04 Thread Alban Hertroys
Peter Eisentraut wrote: Frank Church wrote: error: cannot cast tupe double precision to timestamp without time zone What is the right syntax? It's not clear what the meaning of a double precision as a timestamp would be. How about you make that explicit: "timestamp" * interval '1 second'

Re: [GENERAL] Syntax for converting double to a timestamp

2006-09-03 Thread Tom Lane
"Frank Church" <[EMAIL PROTECTED]> writes: > I tried the query in this form: > select *, "timestamp" * interval '1 second' + timestamp '1900-01-01 > 00:00:00' from ccmanager_log Try timestamp plus interval, instead of the other way. (We did add the operator in this direction in 8.0 though ... pe

Re: [GENERAL] Syntax for converting double to a timestamp

2006-09-03 Thread Frank Church
Peter's suggestion did not work. On 9/4/06, Michael Glaesemann <[EMAIL PROTECTED]> wrote: Please reply to the list so that others may contribute to and learn from the discussion. I am now getting familiar with google mail On Sep 4, 2006, at 8:34 , Frank Church wrote: > ERROR: function to

Re: [GENERAL] Syntax for converting double to a timestamp

2006-09-03 Thread Frank Church
On 9/4/06, Peter Eisentraut <[EMAIL PROTECTED]> wrote: Frank Church wrote: > error: cannot cast tupe double precision to timestamp without time > zone > > What is the right syntax? It's not clear what the meaning of a double precision as a timestamp would be. How about you make that explicit:

Re: [GENERAL] Syntax for converting double to a timestamp

2006-09-03 Thread Michael Glaesemann
Please reply to the list so that others may contribute to and learn from the discussion. On Sep 4, 2006, at 8:34 , Frank Church wrote: ERROR: function to_timestamp(double precision) does not exist HINT: No function matches the given name and argument types. You may need to add explicit ty

Re: [GENERAL] Syntax for converting double to a timestamp

2006-09-03 Thread Peter Eisentraut
Frank Church wrote: > error: cannot cast tupe double precision to timestamp without time > zone > > What is the right syntax? It's not clear what the meaning of a double precision as a timestamp would be. How about you make that explicit: "timestamp" * interval '1 second' + timestamp '1900-01-0

Re: [GENERAL] Syntax for converting double to a timestamp

2006-09-03 Thread Michael Glaesemann
On Sep 4, 2006, at 7:57 , Frank Church wrote: I am trying to create a view based on this query 'select *, "timestamp"::timestamp from ccmanager_log' What is the right syntax? Try this: select *, to_timestamp("timestamp") from ccmanager_log http://www.postgresql.org/docs/current/intera

[GENERAL] Syntax for converting double to a timestamp

2006-09-03 Thread Frank Church
I am trying to create a view based on this query 'select *, "timestamp"::timestamp from ccmanager_log' This is the error I get to below, how do I use the time zone syntax error: cannot cast tupe double precision to timestamp without time zone What is the right syntax? The column to be conve