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

From: Suzuki Hironobu <hironobu(at)interdb(dot)jp>
To: sachin kotwal <kotsachin(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1)
Date: 2013-06-27 12:41:52
Message-ID: 51CC3310.20700@interdb.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Igor Neyman 2013-06-27 13:44:41 Re: installer woes, 9.1 on windows 2008 R2
Previous Message David Greco 2013-06-27 12:24:14 auto_explain & FDW