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

From sachin kotwal
Subject Re: Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1)
Date
Msg-id 1372393853411-5761628.post@n5.nabble.com
Whole thread Raw
In response to Re: Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1)  (Daniel Cristian Cruz <danielcristian@gmail.com>)
List pgsql-general
>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 no need
to define new function.(3 rd row)

\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)


But why this function requires "" to get execute.




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


pgsql-general by date:

Previous
From: sachin kotwal
Date:
Subject: Re: Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1)
Next
From: Vincent Veyron
Date:
Subject: Re: utf8 errors