binary upgade errors
| От | David G. Johnston | 
|---|---|
| Тема | binary upgade errors | 
| Дата | |
| Msg-id | CAKFQuwb-_tjmPASHO9WV_q6-3EUnUoS1+h5F7JFHB4CwGUVwtg@mail.gmail.com обсуждение исходный текст  | 
		
| Ответ на | RE: binary upgade errors (David Modica <davidmo@imaginesoftware.com>) | 
| Список | 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 по дате отправления: