Re: [GENERAL] Time and date functions give me headaches!!

2005-04-11 Thread Scott Marlowe
On Mon, 2005-04-11 at 04:40, Costin Manda wrote: > Hello, > > I have a table with columns defines as varchar that have values in format > '-MM-DD HH:MM:SS'. > > Now, if I do a > select timestamp '2005-10-10 10:10:10'; > I get the value just fine. I can use abstime()::integer on the result t

Re: [GENERAL] Time and date functions give me headaches!!

2005-04-11 Thread Tom Lane
"Costin Manda" <[EMAIL PROTECTED]> writes: > select setuptime::timestamp from billing; - error (cannot cast type > character varying to timestamp without timezone!?) It works for me in 8.0. In some releases you need to cast to text first, for example in 7.4: regression=# select '2005-10-10 10:10

Re: [GENERAL] Time and date functions give me headaches!!

2005-04-11 Thread Csaba Nagy
Costin, You could probably use one of the functions listed here: file:///usr/share/doc/postgresql-7.4.2/html/functions-formatting.html If you want the varchar -> date conversion to happen automatically, you should study this chapter: file:///usr/share/doc/postgresql-7.4.2/html/typeconv.html HTH,

[GENERAL] Time and date functions give me headaches!!

2005-04-11 Thread Costin Manda
Hello, I have a table with columns defines as varchar that have values in format '-MM-DD HH:MM:SS'. Now, if I do a select timestamp '2005-10-10 10:10:10'; I get the value just fine. I can use abstime()::integer on the result to find the unix timestamp. (This is the simplest way I could find