Re: arbitrary "interval" expression OK with "at time zone" but not with "set time zone" — Why?

2021-06-03 Thread Bryn Llewellyn
Thanks, as ever, Tom, for the quick response. I’ll summarize your explanation as “Yes, there is indeed a logical parsing paradox”. Or, as you said, as “the SQL Standard committee—the gift that keeps on giving”. > Tom wrote: > >> Bryn wrote: >> >> The "at time zone" clause that can decorate a t

Re: arbitrary "interval" expression OK with "at time zone" but not with "set time zone" — Why?

2021-06-03 Thread Tom Lane
Bryn Llewellyn writes: > The "at time zone" clause that can decorate a timetsamp[tz] value seems > to allow an argument that’s an arbitrary expression that yields a value > whose data type is "interval". AT TIME ZONE is part of the SQL expression syntax, thus it's unsurprising that its arguments

Re: arbitrary "interval" expression OK with "at time zone" but not with "set time zone" — Why?

2021-06-03 Thread Adrian Klaver
On 6/3/21 2:40 PM, Bryn Llewellyn wrote: The "at time zone" clause that can decorate a timetsamp[tz] value seems to allow an argument that’s an arbitrary expression that yields a value whose data type is "interval". Here’s a contrived exotic example: select '2021-05-21 12:00:00 UTC'::timestamp

arbitrary "interval" expression OK with "at time zone" but not with "set time zone" — Why?

2021-06-03 Thread Bryn Llewellyn
The "at time zone" clause that can decorate a timetsamp[tz] value seems to allow an argument that’s an arbitrary expression that yields a value whose data type is "interval". Here’s a contrived exotic example: select '2021-05-21 12:00:00 UTC'::timestamptz at time zone ('2015-05-21 17:00:00'::t