Search Postgresql Archives

Problem with CAST-ing - am I missing something?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

One of the things I really like about PostgreSQL is that it normally
does what I expect it to do - very little cognitive dissonance. But
I'm puzzled by something I came across this evening - took me ages to
figure it out!

I have a table (sample) as follows (code on fiddle:):

CREATE TABLE test (ts, te)
AS VALUES ('2023-10-25 14:33:00'::TIMESTAMPTZ, '2023-10-25
15:56:00'::TIMESTAMPTZ);

Now, this doesn't work:

SELECT (ts, te)::TSTZRANGE FROM test;

but this does:

SELECT TSTZRANGE(ts, te) FROM test;

Bug? Niggle? Can anyone explain to me why this is? To me, it's obvious
what I want to do with the first statement - ideas, pointers, URLs,
whatever welcome.

TIA and rgs,

Pól...






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux