Re: Attach comments to functions' parameters and return value

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: Attach comments to functions' parameters and return value
Дата
Msg-id 5664E2D0.4040809@BlueTreble.com
обсуждение исходный текст
Ответ на Re: Attach comments to functions' parameters and return value  (Charles Clavadetscher <clavadetscher@swisspug.org>)
Список pgsql-hackers
On 9/15/15 12:35 AM, Charles Clavadetscher wrote:
> COMMENT ON FUNCTION function_name ( [ [ argmode ] [ argname ] argtype [,
> ...] ] ) PARAMETER param_position IS 'text';
>
> COMMENT ON FUNCTION function_name ( [ [ argmode ] [ argname ] argtype [,
> ...] ] ) RETURN VALUE IS 'text';
>
> An alternative to "RETURN VALUE" could be "RETURNS", which would make
> the statement shorter, but I think this may be confusing.

I like RETURN VALUE better myself.

> The parameter list of the function is only required to identify the
> function also in cases it exists with the same name in different
> flavours. This sticks to the general syntax of the command and should be
> easy to understand.

Right. You should be able to use the current COMMENT ON code. Note 
however that the last time I looked it does NOT support the full syntax 
that CREATE FUNCTION does. It'd be nice to fix that, but that's mostly a 
separate matter.

Though, it would probably be nice if all of this stuff (along with the 
regprocedure input function) could be factored into a single piece of 
code...
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com



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

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: Double linking MemoryContext children
Следующее
От: Peter Eisentraut
Дата:
Сообщение: jsonb_delete not documented