Re: patch: make_timestamp function - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: patch: make_timestamp function
Date
Msg-id CAFj8pRDbwEhEoNGcKx4ujXNuYucXqdpR=+SzJe4Jbv54VtmbHw@mail.gmail.com
Whole thread Raw
In response to Re: patch: make_timestamp function  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: patch: make_timestamp function
List pgsql-hackers
Hello

updated patch - optional time zone is as text.

postgres=# SELECT make_timetz(8, 15, 55.333) = '8:15:55.333'::timetz;
 ?column?
----------
 t
(1 row)

postgres=# SELECT make_timetz(8, 15, 55.333, 'HKT') = '8:15:55.333 HKT'::timetz;
 ?column?
----------
 t
(1 row)

postgres=# SELECT make_timetz(8, 15, 55.333, '+1:30') = '8:15:55.333 +1:30'::timetz;
 ?column?
----------
 t
(1 row)

postgres=# SELECT make_timetz(8, 15, 55.333, '-1:30') = '8:15:55.333 -1:30'::timetz;
 ?column?
----------
 t
(1 row)

Regards

Pavel


2013/12/17 Tom Lane <tgl@sss.pgh.pa.us>
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Yeah, I think a constructor should allow a text timezone.

Yes.  I think a numeric timezone parameter is about 99% useless,
and if you do happen to need that behavior you can just cast the
numeric to text no?

                        regards, tom lane

Attachment

pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: row security roadmap proposal
Next
From: Andres Freund
Date:
Subject: Re: 9.3 reference constraint regression