Re: [GENERAL] Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1)

2013-06-27 Thread sachin kotwal
>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

Re: [GENERAL] Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1)

2013-06-27 Thread sachin kotwal
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 ---

Re: [GENERAL] Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1)

2013-06-27 Thread John R Pierce
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

Re: [GENERAL] Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1)

2013-06-27 Thread Suzuki Hironobu
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.

Re: [GENERAL] Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1)

2013-06-27 Thread Daniel Cristian Cruz
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

Re: [GENERAL] Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1)

2013-06-27 Thread Raymond O'Donnell
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

Re: [GENERAL] Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1)

2013-06-27 Thread sachin kotwal
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); =

[GENERAL] Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1)

2013-06-27 Thread sachin kotwal
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)