>I've done something weird:
>CREATE OR REPLACE FUNCTION "timestamp"(_date date, _time time) RETURNS
timestamp AS $$
>SELECT _date + _time;
>$$ LANGUAGE sql;
>SELECT "timestamp"('2013-01-01'::date, '12:00:00'::time);
Good one.
function with above definition is already present in pg_catalog. so n
Using your link
http://www.postgresql.org/docs/9.2/static/functions-formatting.html
In DB2 when I use following command I am getting output combined date and
time i passed to function.
#SELECT TIMESTAMP('2013-01-01','12:13:14') FROM SYSIBM.SYSDUMMY1
1
---
On 6/27/2013 4:51 AM, sachin kotwal wrote:
#select timestamp(current_date);
try... current_date::timestamptz
orcast current_date as timestamptz
--
john r pierce 37N 122W
somewhere on the middle of the left coast
--
Sent via pgsql-general maili
On 2013-06-27 20:43, sachin kotwal wrote:
While migrating my application from DB2 to PostgreSQL.
I want to migrate TIMESTAMP() function of DB2 into PostgreSQL.
Example in DB2:
#SELECT TIMESTAMP('2013-01-01','12:13:14') FROM SYSIBM.SYSDUMMY1
1
--
2013-01-01-12.13.14.
I've done something weird:
CREATE OR REPLACE FUNCTION "timestamp"(_date date, _time time) RETURNS
timestamp AS $$
SELECT _date + _time;
$$ LANGUAGE sql;
SELECT "timestamp"('2013-01-01'::date, '12:00:00'::time);
It worked, but you will need explict cast and quote the timestamp function
name... M
On 27/06/2013 12:51, sachin kotwal wrote:
> I have done some more try as follows:
>
> #select timestamp(current_date);
> ERROR: syntax error at or near "current_date" at character 18
> STATEMENT: select timestamp(current_date);
> ERROR: syntax error at or near "current_date"
> LINE 1: select ti
I have done some more try as follows:
#select timestamp(current_date);
ERROR: syntax error at or near "current_date" at character 18
STATEMENT: select timestamp(current_date);
ERROR: syntax error at or near "current_date"
LINE 1: select timestamp(current_date);
=
While migrating my application from DB2 to PostgreSQL.
I want to migrate TIMESTAMP() function of DB2 into PostgreSQL.
Example in DB2:
#SELECT TIMESTAMP('2013-01-01','12:13:14') FROM SYSIBM.SYSDUMMY1
1
--
2013-01-01-12.13.14.00
1 record(s)