Re: Types pollution with iso-8859-1 oids and server-side parameters binding

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Types pollution with iso-8859-1 oids and server-side parameters binding
Дата
Msg-id 2234572.1651616332@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Types pollution with iso-8859-1 oids and server-side parameters binding  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-bugs
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Tue, May 3, 2022 at 12:55 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> What do you think ought to happen?  The same parameter somehow having
>> different types in different places?

> Based upon:
> "When a parameter's data type is not specified or is declared as unknown,
> the type is inferred from the context in which the parameter is first
> referenced (if possible)."

Right ...

> The parameter would seem to be first referenced as a timestamp (at least in
> parsing order).

Actually, if you look at transformUpdateStmt, you'll see the parsing
order is WITH, then FROM, then WHERE, then RETURNING, then the targetlist.
Some of this is constrained by semantics: we have to do WITH first because
it'll define pseudo-tables used in FROM, and we have to do FROM before
we can make sense of the rest.  We could possibly do the targetlist
before WHERE, but any assumption that it works left-to-right is just
doomed to failure by the poor consistency of SQL syntax.

            regards, tom lane



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Types pollution with iso-8859-1 oids and server-side parameters binding
Следующее
От: Daniele Varrazzo
Дата:
Сообщение: Re: Types pollution with iso-8859-1 oids and server-side parameters binding