Re: Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1) - Mailing list pgsql-general

From Suzuki Hironobu
Subject Re: Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1)
Date
Msg-id 51CC3310.20700@interdb.jp
Whole thread Raw
In response to Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1)  (sachin kotwal <kotsachin@gmail.com>)
List pgsql-general
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.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.
>
>

Hi,

# SELECT pg_catalog.timestamp('2013-01-01'::date, '12:13:14'::time);
       timestamp
---------------------
  2013-01-01 12:13:14
(1 row)





pgsql-general by date:

Previous
From: David Greco
Date:
Subject: auto_explain & FDW
Next
From: Igor Neyman
Date:
Subject: Re: installer woes, 9.1 on windows 2008 R2