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


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to