binary upgade errors - Mailing list pgsql-admin

From David G. Johnston
Subject binary upgade errors
Date
Msg-id CAKFQuwb-_tjmPASHO9WV_q6-3EUnUoS1+h5F7JFHB4CwGUVwtg@mail.gmail.com
Whole thread Raw
In response to RE: binary upgade errors  (David Modica <davidmo@imaginesoftware.com>)
List pgsql-admin
On Monday, June 18, 2018, David Modica <davidmo@imaginesoftware.com> wrote:
isn't 0::uint1 casting an int as uint and '0'::uint1 is casting a text as a uint1 ?

The second one isn't casting, period.  It is an alternate spelling of "uint1 '0'" which itself is how you write a typed literal in SQL (:: syntax is a PostgreSQL extension).  The text between the single quotes is an untyped character string that gets passed directly into the declared type's constructor/_in function.

Since the first one is not quoted the value is interpreted as a number (special case reserved for core types, I think) and the :: is then interpreted as a cast in order to go from the number to the custom type.

David J.

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: binary upgade errors
Next
From: "Heinemann, Manfred (IMS)"
Date:
Subject: RE: Segmentation fault with parallelism PG 10.4