Re: unique names in variables and columns in plsql functions

Поиск
Список
Период
Сортировка
От Wiebe Cazemier
Тема Re: unique names in variables and columns in plsql functions
Дата
Msg-id 44285B78.8010804@gmail.com
обсуждение исходный текст
Ответ на Re: unique names in variables and columns in plsql functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
(Whoops, pressed wrong reply button. Here it is correctly this time.)

On 03/27/06 17:02, Tom Lane wrote:

>It'll retrieve whatever the current value of the plpgsql variable
>provider_id is.  plpgsql always assumes that ambiguous names refer
>to its variables (indeed, it isn't even directly aware that there's
>any possible ambiguity here).
>
>
That's why I suspected it would be NULL, since provider_id wasn't
initialised yet.

>
>How and why would it determine that?  In general it's perfectly normal
>to use plpgsql variable values in SQL commands.  I don't think it'd make
>the system more usable if the parser tried to apply a heuristic rule
>about some occurrences being meant as variable references and other ones
>not.  If the rule ever got it wrong, it'd be even more confusing.
>
I guess I'm looking at it too much as a human. I said "SELECT FROM" so,
it guess I assumed it would be clear enough which one it had to use.
But, now that I'm thinking about it some more, I agree. However, a fatal
error would also have been welcome.


Вложения

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

Предыдущее
От: Wiebe Cazemier
Дата:
Сообщение: Re: unique names in variables and columns in plsql functions
Следующее
От: Maciej Piekielniak
Дата:
Сообщение: cursor and for update