On 1/1/16 4:11 AM, Thomas Kellerer wrote:
You only need to provide the text value to be casted (no format mask).
Use only a single expression without those unnecessary parentheses:

     SELECT gmt_date||' '||lpad(gmt_time,8,'0')::timestamp

You don't need the lpad() either:

     SELECT gmt_date||' '||gmt_time::timestamp

I suspect you need to wrap that in (). Even if the parser does the right thing there, it'd certainly make the intent a lot clearer.

SELECT (gmt_date || ' ' || gmt_time)::timestamp
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to