Re: Local variable and column name conflict

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Local variable and column name conflict
Дата
Msg-id 3434.1151941074@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Local variable and column name conflict  ("Daniel Caune" <daniel.caune@ubisoft.com>)
Список pgsql-sql
"Daniel Caune" <daniel.caune@ubisoft.com> writes:
> CREATE OR REPLACE FUNCTION foo(i IN int)
>   RETURNS void
> AS $$
> BEGIN
>   UPDATE bar
>     SET i = i; // column i = parameter i
> END;
> $$ LANGUAGE PLPGSQL;

In SELECTs you can qualify the column, ie, bar.i vs i.  That doesn't
work for an UPDATE target, though, so probably the best answer is
"don't do that".  I think it's entirely too error-prone anyway ...
        regards, tom lane


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