comments in argument list of plpgsql get stripped?
От | Ralph Graulich |
---|---|
Тема | comments in argument list of plpgsql get stripped? |
Дата | |
Msg-id | 20E4ABC3-DE3C-4882-9E58-9808638976D0@shauny.de обсуждение исходный текст |
Ответы |
Re: comments in argument list of plpgsql get stripped?
Re: comments in argument list of plpgsql get stripped? |
Список | 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 по дате отправления: