Time and date functions give me headaches!! - Mailing list pgsql-general

From Costin Manda
Subject Time and date functions give me headaches!!
Date
Msg-id 1875.193.226.119.24.1113212448.squirrel@193.226.119.24
Whole thread Raw
In response to Help!!  (Edson Vilhena de Carvalho <edson_jvc@yahoo.com>)
Responses Re: Time and date functions give me headaches!!  (Csaba Nagy <nagy@ecircle-ag.com>)
Re: Time and date functions give me headaches!!  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Time and date functions give me headaches!!  (Scott Marlowe <smarlowe@g2switchworks.com>)
List pgsql-general
  Hello,

I have a table with columns defines as varchar that have values in format
'YYYY-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, are there
any others?)

However, when I try doing the same with the values in the table I can't
get it to work.

select timestamp setuptime from billing; - error
select timestamp(setuptime) from billing; - error
select setuptime::timestamp from billing; - error (cannot cast type
character varying to timestamp without timezone!?)

So, how can I convert this string into a timestamp, pleeease! :(




-------------------------
E-Mail powered by MadNet.
http://www.madnet.ro/


pgsql-general by date:

Previous
From: "Jinane Haddad"
Date:
Subject: What are the consequences of a bad database design (never seen that before !)
Next
From: Rafael.Hernamperez@bull.es
Date:
Subject: Re: What are the consequences of a bad database design (never