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

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: WIP: Allow SQL-language functions to reference parameters by parameter name
Дата
Msg-id 1303144262-sup-8577@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: WIP: Allow SQL-language functions to reference parameters by parameter name  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: WIP: Allow SQL-language functions to reference parameters by parameter name  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-hackers
Excerpts from Robert Haas's message of lun abr 18 09:33:06 -0300 2011:

> I don't much like Jim's syntax suggestion (the alias really ought to
> be declared within the function body, I think, not added to the CREATE
> FUNCTION statement) but I don't necessarily think it's a bad idea.
> What would be even better, in my view, is having a short alias that is
> defined by default, but all previous proposals in this vein have been
> shot down by Tom and Andrew.  As a practical matter, though, I think
> what Jim is talking about speaks to a real need - people want to make
> SQL function names long and descriptive, but they do NOT want to spell
> out that long function name 16 times inside the function body.

plpgsql has the #option thing in functions; why can't we have something
similar in SQL functions?
CREATE FUNCTION function_with_really_really_descriptive_name ( some_parameter int) RETURNS int LANGUAGE SQL AS $$
#optionfunction_alias fwrrdn       SELECT fwrrdn.some_parameter$$;
 

Not necessarily that exact syntax.

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: switch UNLOGGED to LOGGED
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: [JDBC] JDBC connections to 9.1