From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | David Modica <davidmo(at)imaginesoftware(dot)com> |
Cc: | "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org> |
Subject: | Re: binary upgade errors |
Date: | 2018-06-18 20:10:33 |
Message-ID: | 24414.1529352633@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
David Modica <davidmo(at)imaginesoftware(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2018-06-18 20:19:30 | binary upgade errors |
Previous Message | David Modica | 2018-06-18 19:53:26 | RE: binary upgade errors |