Re: binary upgade errors

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: binary upgade errors
Дата
Msg-id 24414.1529352633@sss.pgh.pa.us
обсуждение исходный текст
Ответ на RE: binary upgade errors  (David Modica <davidmo@imaginesoftware.com>)
Список pgsql-admin
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


В списке pgsql-admin по дате отправления:

Предыдущее
От: David Modica
Дата:
Сообщение: RE: binary upgade errors
Следующее
От: "David G. Johnston"
Дата:
Сообщение: binary upgade errors