Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1)

From: sachin kotwal <kotsachin(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1)
Date: 2013-06-27 11:43:31
Message-ID: 1372333411359-5761389.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.000000

1 record(s) selected.
==========================

Example PostgreSQL:

#SELECT TIMESTAMP('2013-01-01','12:13:14');
ERROR: syntax error at or near "'2013-01-01'" at character 18
STATEMENT: SELECT TIMESTAMP('2013-01-01','12:13:14');
ERROR: syntax error at or near "'2013-01-01'"
LINE 1: SELECT TIMESTAMP('2013-01-01','12:13:14');

After executing above SQL I am getting error.

I checked definition of TIMESTAMP().
It is as follows:
test=# \df timestamp
List of functions
Schema | Name | Result data type | Argument
data types | Type
------------+-----------+-----------------------------+--------------------------------------+--------
pg_catalog | timestamp | timestamp without time zone | abstime
| normal
pg_catalog | timestamp | timestamp without time zone | date
| normal
pg_catalog | timestamp | timestamp without time zone | date, time without
time zone | normal
pg_catalog | timestamp | timestamp without time zone | timestamp without
time zone, integer | normal
pg_catalog | timestamp | timestamp without time zone | timestamp with time
zone | normal
(5 rows)

As we can see TIMESTAMP() hast two arguments date and time without time
stamp but still it is giving error to me.

Please reply if any suggestion.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Migration-from-DB2-to-PostgreSQL-TIMESTAMP-arg1-arg1-tp5761389.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message sachin kotwal 2013-06-27 11:51:16 Re: Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1)
Previous Message Magnus Hagander 2013-06-27 07:39:42 Re: LDAP referrals