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

From Christophe Pettus
Subject Re: Problem with CAST-ing - am I missing something?
Date
Msg-id 3E465C5A-D794-41B2-B481-DDACC10B41DD@thebuild.com
Whole thread Raw
In response to Problem with CAST-ing - am I missing something?  (Pól Ua Laoínecháin <linehanp@tcd.ie>)
Responses Re: Problem with CAST-ing - am I missing something?  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general

> On Oct 25, 2023, at 17:21, Pól Ua Laoínecháin <linehanp@tcd.ie> wrote:
>
> SELECT (ts, te)::TSTZRANGE FROM test;

That syntax doesn't mean what you probably think it does.  (ts, te) defines a record type with two fields.  PostgreSQL
constructsthat, and then attempts to apply the cast.  There's no conversion path from that to TSTZRANGE, so the system
complains. It's imaginable, I guess, that such a path could be added, but the right way to do it is what you do here: 

> SELECT TSTZRANGE(ts, te) FROM test;





pgsql-general by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: setting up streaming replication, part 2
Next
From: Adrian Klaver
Date:
Subject: Re: Problem with CAST-ing - am I missing something?