comments in argument list of plpgsql get stripped? - Mailing list pgsql-general

From Ralph Graulich
Subject comments in argument list of plpgsql get stripped?
Date
Msg-id 20E4ABC3-DE3C-4882-9E58-9808638976D0@shauny.de
Whole thread Raw
Responses Re: comments in argument list of plpgsql get stripped?  (Raymond O'Donnell <rod@iol.ie>)
Re: comments in argument list of plpgsql get stripped?  ("David Johnston" <polobo@yahoo.com>)
List pgsql-general
Hi,

How can I store inline comments in the argument list of a plpgsql function to document complex overloaded functions
withlots of arguments? It seems that PostgreSQL accepts the comments, but strips them as the function gets stored. 

I am using PostgreSQL 9.1.2.

+++
CREATE FUNCTION func_test(
    -- comment for argument 1
    -- quite longish, explaining the details
    argument1 TEXT
    -- comment for argument 2
    -- even more information
    , argument2 TEXT
)
RETURNS smallint AS
$BODY$
BEGIN
-- this comment gets stored correctly
RETURN 1;
END;
$BODY$
LANGUAGE plpgsql IMMUTABLE
COST 100;
+++

According to the server log file PostgreSQL gets sent all the comments correctly, so it is not the client that already
stripsthe comments. 

+++
[...]
statement: CREATE FUNCTION func_test(
        -- comment for argument 1
        -- quite longish, explaining the details
        argument1 TEXT
        -- comment for argument 2
        -- even more information
        , argument2 TEXT
    )
    RETURNS smallint AS
    $BODY$
    BEGIN
    -- this comment gets stored correctly
    RETURN 1;
    END;
    $BODY$
    LANGUAGE plpgsql IMMUTABLE
    COST 100;
+++


select func_test('foo', 'bar');
 func_test
-----------
         1
(1 row)


Best regards,
   Ralph


pgsql-general by date:

Previous
From: Edison So
Date:
Subject: PGbouncer for Windows 2008
Next
From: Brice Maron
Date:
Subject: Re: Immutable function with bind value