Re: schema agnostic functions in language sql
От | David G. Johnston |
---|---|
Тема | Re: schema agnostic functions in language sql |
Дата | |
Msg-id | CAKFQuwYy5p3V6DmSn5-y91QUiWXQ75BPi9MChx+HQhK2=vveiQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: schema agnostic functions in language sql (Rob Sargent <robjsargent@gmail.com>) |
Ответы |
Re: schema agnostic functions in language sql
Re: schema agnostic functions in language sql |
Список | pgsql-general |
On Fri, May 15, 2020 at 4:07 PM Rob Sargent <robjsargent@gmail.com> wrote:
I'm terribly sorry: I needed to add that plpgsql works without any
knowledge of the schema, where as defining a plain sql functions does
not work without schema qualification.
You need to distinguish between "works" as in "compiles" and "works" as in "executes".
Yes, SQL and pl/pgsql have very different behaviors when it comes to compilation and execution. In particular SQL performs parsing earlier (during creation - just like it does for views) and links the textual query to its parse result earlier. For pl/pgsql none of that happens until the function is called. Because of this pl/pgsql allows for ambiguous sql text to exist and be concretely resolved during execution while SQL does not.
David J.
В списке pgsql-general по дате отправления: