Re: WIP: Allow SQL-language functions to reference parameters by parameter name

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: WIP: Allow SQL-language functions to reference parameters by parameter name
Дата
Msg-id m2zkohd1gv.fsf@2ndQuadrant.fr
обсуждение исходный текст
Ответ на Re: WIP: Allow SQL-language functions to reference parameters by parameter name  (Joshua Berkus <josh@agliodbs.com>)
Ответы Re: WIP: Allow SQL-language functions to reference parameters by parameter name  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: WIP: Allow SQL-language functions to reference parameters by parameter name  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Joshua Berkus <josh@agliodbs.com> writes:
>> Personally I'd vote for *not* having any such dangerous semantics as
>> that. We should have learned better by now from plpgsql experience.
>> I think the best idea is to throw error for ambiguous references,
>> period. 
>
> As a likely heavy user of this feature, I agree with Tom here.  I really
> don't want the column being silently preferred in SQL functions, when
> PL/pgSQL functions are throwing an error.  I'd end up spending hours
> debugging this.

+1

I think the best choice is to only accept qualified parameter names in
SQL functions (function_name.parameter_name).  If a referenced table
share the function's name, ERROR out and HINT to alias the table name.

If we allow more than that, we're opening the door to ambiguity, bug
reports, and more than that costly migrations.  I don't see any benefit
in having to audit all SQL functions for ambiguity on a flag day, when
this could be avoided easily.

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


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

Предыдущее
От: Darren Duncan
Дата:
Сообщение: Re: resolving SQL ambiguity (was Re: WIP: Allow SQL-lang funcs to ref params by param name)
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: WIP: Allow SQL-language functions to reference parameters by parameter name