Re: Attach comments to functions' parameters and return value - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: Attach comments to functions' parameters and return value
Date
Msg-id 5664E2D0.4040809@BlueTreble.com
Whole thread Raw
In response to Re: Attach comments to functions' parameters and return value  (Charles Clavadetscher <clavadetscher@swisspug.org>)
List 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 by date:

Previous
From: Jim Nasby
Date:
Subject: Re: Double linking MemoryContext children
Next
From: Peter Eisentraut
Date:
Subject: jsonb_delete not documented