Problem with CAST-ing - am I missing something?

Поиск
Список
Период
Сортировка
От Pól Ua Laoínecháin
Тема Problem with CAST-ing - am I missing something?
Дата
Msg-id CAF4RT5QB7EY2SzeXBUdF9nB_ZPdMD0bab7zRZo4LqLVk=XWQEQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Problem with CAST-ing - am I missing something?
Re: Problem with CAST-ing - am I missing something?
Список 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 по дате отправления:

Предыдущее
От: Atul Kumar
Дата:
Сообщение: purpose of an entry in pg_hba.conf file
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: purpose of an entry in pg_hba.conf file