Re: [GENERAL] to_timestamp alternatives

2015-12-31 Thread gkhan
Follow-up: My initial question was about oddly-formatted date/times. The suggested solution of casting directly to timestamp with ::timestamp is not as flexible as the to_timestamp function that I was trying to avoid. For example, this fails because of the day-before-month format: SELECT

Re: [GENERAL] to_timestamp alternatives

2015-12-31 Thread gkhan
...I meant to add, "and we therefore try to store all time and date values in 'timestamp without time zone' variables. -- View this message in context: http://postgresql.nabble.com/to-timestamp-alternatives-tp5879723p5879739.html Sent from the PostgreSQL - general mailing list archive at

Re: [GENERAL] to_timestamp alternatives

2015-12-31 Thread gkhan
Thanks very much for both of your replies. I had tried something similar and gotten an error, so I am probably making a stupid mistake. If I try this, it works: SELECT ('09.03.2014'||' '||lpad('3:00:00',8,'0'),'DD.MM. HH24:MI:SS')::timestamp but if I use column names instead of the

Re: [GENERAL] to_timestamp alternatives

2015-12-31 Thread gkhan
Oh sorry, what a dumb mistake! ::timestamp works, of course! Thanks -- View this message in context: http://postgresql.nabble.com/to-timestamp-alternatives-tp5879723p5879746.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list

[GENERAL] to_timestamp alternatives

2015-12-31 Thread gkhan
Hi. I have a practical need to convert some badly-formatted date/times into 'timestamp without time zone' data types. Like other scientists, I try to avoid timezone problems by sticking to UTC and using the 'timestamp without time zone' data type whenever possible. In this case, I used the