Search Postgresql Archives

comments in argument list of plpgsql get stripped?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

How can I store inline comments in the argument list of a plpgsql function to document complex overloaded functions with lots 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 strips the 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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux