Problem with CAST-ing - am I missing something? - Mailing list pgsql-general

From Pól Ua Laoínecháin
Subject Problem with CAST-ing - am I missing something?
Date
Msg-id CAF4RT5QB7EY2SzeXBUdF9nB_ZPdMD0bab7zRZo4LqLVk=XWQEQ@mail.gmail.com
Whole thread Raw
Responses Re: Problem with CAST-ing - am I missing something?
Re: Problem with CAST-ing - am I missing something?
List pgsql-general
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...



pgsql-general by date:

Previous
From: Atul Kumar
Date:
Subject: purpose of an entry in pg_hba.conf file
Next
From: "David G. Johnston"
Date:
Subject: Re: purpose of an entry in pg_hba.conf file