Re: Assigning a timestamp without timezone to a timestamp
От | chrisj |
---|---|
Тема | Re: Assigning a timestamp without timezone to a timestamp |
Дата | |
Msg-id | 6847852.post@talk.nabble.com обсуждение исходный текст |
Ответ на | Re: Assigning a timestamp without timezone to a timestamp (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Assigning a timestamp without timezone to a timestamp
|
Список | pgsql-sql |
Thanks Tom that's great!! When I first saw your solution I thought it was logically going to do (notice the parentheses): select ('2006-07-13 09:20:00'::timestamp) at time zone 'EST5EDT'; which does not help So I was not hopeful, but when I tried it it did exactly what I needed which is: select '2006-07-13 09:20:00'::(timestamp at time zone 'EST5EDT'); My adjusted SQL is: select start_datetime , cast(start_datetime as timestamp(0) without time zone)::timestamp at time zone B.timezone_ch from reservation A , location B where A.appt_key = 7 and B.locn_key = 102; thank-you so much Tom Lane-2 wrote: > > chrisj <chrisj.wood@sympatico.ca> writes: >> Did not seem to help: >> ERROR: invalid input syntax for type timestamp with time zone: >> "2006-07-13 >> 09:20:00 America/New_York" > > Sorry, I was thinking in terms of CVS HEAD ... the ability to use a full > timezone spec in timestamptz input is new for 8.2. You might be able to > use this, which does work in 8.1: > > select '2006-07-13 09:20:00'::timestamp at time zone 'EST5EDT'; > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 6: explain analyze is your friend > > -- View this message in context: http://www.nabble.com/Assigning-a-timestamp-without-timezone-to-a-timestamp-with-timezone-tf2373845.html#a6847852 Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
В списке pgsql-sql по дате отправления: