binary upgade errors

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: David Modica <davidmo(at)imaginesoftware(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: binary upgade errors
Date: 2018-06-18 20:19:30
Message-ID: CAKFQuwb-_tjmPASHO9WV_q6-3EUnUoS1+h5F7JFHB4CwGUVwtg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Monday, June 18, 2018, David Modica <davidmo(at)imaginesoftware(dot)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.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Heinemann, Manfred (IMS) 2018-06-19 14:49:53 RE: Segmentation fault with parallelism PG 10.4
Previous Message Tom Lane 2018-06-18 20:10:33 Re: binary upgade errors