Search Postgresql Archives

Re: Problem with CAST-ing - am I missing something?

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

 




> On Oct 25, 2023, at 17:21, Pól Ua Laoínecháin <linehanp@xxxxxx> 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 constructs that, 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;








[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