From: | sachin kotwal <kotsachin(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1) |
Date: | 2013-06-28 04:30:53 |
Message-ID: | 1372393853411-5761628.post@n5.nabble.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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.
From | Date | Subject | |
---|---|---|---|
Next Message | Vincent Veyron | 2013-06-28 06:10:44 | Re: utf8 errors |
Previous Message | sachin kotwal | 2013-06-28 04:18:34 | Re: Migration from DB2 to PostgreSQL-TIMESTAMP(arg1,arg1) |