From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Modica <davidmo@imaginesoftware.com>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: binary upgade errors
Date: Mon, 18 Jun 2018 16:10:33 -0400
Message-ID: <24414.1529352633@sss.pgh.pa.us> (raw)
In-Reply-To: <0c70b27484974f60aae44d91101893a0@imaginesoftware.com>
References: <7cb957dd12774a52ac8a680b73910c5b@imaginesoftware.com>
<10537.1529007868@sss.pgh.pa.us>
<0c70b27484974f60aae44d91101893a0@imaginesoftware.com>
David Modica <davidmo@imaginesoftware.com> writes:
> isn't 0::uint1 casting an int as uint and '0'::uint1 is casting a text as a uint1 ?
No. 0 is an integer constant and so the first case requires invoking
an int -> uint1 cast. The second syntax implies applying uint1's type
input function to the string '0', and arriving at a constant immediately.
It's perhaps unfortunate that similar-looking syntax means two basically
different things ... but it's not the only place in SQL where much turns
on punctuation.
https://www.postgresql.org/docs/current/static/sql-expressions.html#SQL-SYNTAX-TYPE-CASTS
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, davidmo@imaginesoftware.com, pgsql-admin@lists.postgresql.org
Subject: Re: binary upgade errors
In-Reply-To: <24414.1529352633@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox