From 357ea45b5772486395c7fbddccdca22ca1b7c1ae Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 26 May 2005 20:05:03 +0000 Subject: [PATCH] Document that utility commands such as DROP FUNCTION allow argument names and modes to be included when naming an existing function. --- doc/src/sgml/ref/alter_function.sgml | 50 ++++++++++++++--- doc/src/sgml/ref/comment.sgml | 80 +++++++++++++++++++++------- doc/src/sgml/ref/drop_function.sgml | 40 ++++++++++++-- doc/src/sgml/ref/grant.sgml | 4 +- doc/src/sgml/ref/revoke.sgml | 4 +- 5 files changed, 142 insertions(+), 36 deletions(-) diff --git a/doc/src/sgml/ref/alter_function.sgml b/doc/src/sgml/ref/alter_function.sgml index 468aa2b2e2e..2f4b901f48e 100644 --- a/doc/src/sgml/ref/alter_function.sgml +++ b/doc/src/sgml/ref/alter_function.sgml @@ -1,5 +1,5 @@ @@ -20,9 +20,12 @@ PostgreSQL documentation -ALTER FUNCTION name ( [ type [, ...] ] ) action [, ... ] [ RESTRICT ] -ALTER FUNCTION name ( [ type [, ...] ] ) RENAME TO newname -ALTER FUNCTION name ( [ type [, ...] ] ) OWNER TO newowner +ALTER FUNCTION name ( [ [ argmode ] [ argname ] argtype [, ...] ] ) + action [, ... ] [ RESTRICT ] +ALTER FUNCTION name ( [ [ argmode ] [ argname ] argtype [, ...] ] ) + RENAME TO newname +ALTER FUNCTION name ( [ [ argmode ] [ argname ] argtype [, ...] ] ) + OWNER TO newowner where action is one of: @@ -55,10 +58,41 @@ where action is one of: - type + argmode + - The data type of an argument of the function. + The mode of an argument: either IN, OUT, + or INOUT. If omitted, the default is IN. + Note that ALTER FUNCTION does not actually pay + any attention to OUT arguments, since only the input + arguments are needed to determine the function's identity. + So it is sufficient to list the IN and INOUT + arguments. + + + + + + argname + + + + The name of an argument. + Note that ALTER FUNCTION does not actually pay + any attention to argument names, since only the argument data + types are needed to determine the function's identity. + + + + + + argtype + + + + The data type(s) of the function's arguments (optionally + schema-qualified), if any. @@ -116,8 +150,8 @@ where action is one of: - EXTERNAL SECURITY INVOKER - EXTERNAL SECURITY DEFINER + EXTERNAL SECURITY INVOKER + EXTERNAL SECURITY DEFINER diff --git a/doc/src/sgml/ref/comment.sgml b/doc/src/sgml/ref/comment.sgml index 961623c3da3..593df4743c0 100644 --- a/doc/src/sgml/ref/comment.sgml +++ b/doc/src/sgml/ref/comment.sgml @@ -1,5 +1,5 @@ @@ -30,7 +30,7 @@ COMMENT ON CONVERSION object_name | DATABASE object_name | DOMAIN object_name | - FUNCTION func_name (arg1_type, arg2_type, ...) | + FUNCTION func_name ( [ [ argmode ] [ argname ] argtype [, ...] ] ) | INDEX object_name | LARGE OBJECT large_object_oid | OPERATOR op (leftoperand_type, rightoperand_type) | @@ -103,6 +103,64 @@ COMMENT ON + + + sourcetype + + + The name of the source data type of the cast. + + + + + + targettype + + + The name of the target data type of the cast. + + + + + + argmode + + + + The mode of a function argument: either IN, OUT, + or INOUT. If omitted, the default is IN. + Note that COMMENT ON FUNCTION does not actually pay + any attention to OUT arguments, since only the input + arguments are needed to determine the function's identity. + So it is sufficient to list the IN and INOUT + arguments. + + + + + + argname + + + + The name of a function argument. + Note that COMMENT ON FUNCTION does not actually pay + any attention to argument names, since only the argument data + types are needed to determine the function's identity. + + + + + + argtype + + + + The data type(s) of the function's arguments (optionally + schema-qualified), if any. + + + large_object_oid @@ -122,24 +180,6 @@ COMMENT ON - - - sourcetype - - - The name of the source data type of the cast. - - - - - - targettype - - - The name of the target data type of the cast. - - - text diff --git a/doc/src/sgml/ref/drop_function.sgml b/doc/src/sgml/ref/drop_function.sgml index 7cc8b7f4da0..85290acff08 100644 --- a/doc/src/sgml/ref/drop_function.sgml +++ b/doc/src/sgml/ref/drop_function.sgml @@ -1,5 +1,5 @@ @@ -20,7 +20,8 @@ PostgreSQL documentation -DROP FUNCTION name ( [ type [, ...] ] ) [ CASCADE | RESTRICT ] +DROP FUNCTION name ( [ [ argmode ] [ argname ] argtype [, ...] ] ) + [ CASCADE | RESTRICT ] @@ -50,10 +51,41 @@ DROP FUNCTION name ( [ - type + argmode + - The data type of an argument of the function. + The mode of an argument: either IN, OUT, + or INOUT. If omitted, the default is IN. + Note that DROP FUNCTION does not actually pay + any attention to OUT arguments, since only the input + arguments are needed to determine the function's identity. + So it is sufficient to list the IN and INOUT + arguments. + + + + + + argname + + + + The name of an argument. + Note that DROP FUNCTION does not actually pay + any attention to argument names, since only the argument data + types are needed to determine the function's identity. + + + + + + argtype + + + + The data type(s) of the function's arguments (optionally + schema-qualified), if any. diff --git a/doc/src/sgml/ref/grant.sgml b/doc/src/sgml/ref/grant.sgml index 45f384f4868..c1875abb2fe 100644 --- a/doc/src/sgml/ref/grant.sgml +++ b/doc/src/sgml/ref/grant.sgml @@ -1,5 +1,5 @@ @@ -30,7 +30,7 @@ GRANT { { CREATE | TEMPORARY | TEMP } [,...] | ALL [ PRIVILEGES ] } TO { username | GROUP groupname | PUBLIC } [, ...] [ WITH GRANT OPTION ] GRANT { EXECUTE | ALL [ PRIVILEGES ] } - ON FUNCTION funcname ([type, ...]) [, ...] + ON FUNCTION funcname ( [ [ argmode ] [ argname ] argtype [, ...] ] ) [, ...] TO { username | GROUP groupname | PUBLIC } [, ...] [ WITH GRANT OPTION ] GRANT { USAGE | ALL [ PRIVILEGES ] } diff --git a/doc/src/sgml/ref/revoke.sgml b/doc/src/sgml/ref/revoke.sgml index 5f94537e26e..b7bd2faa8ea 100644 --- a/doc/src/sgml/ref/revoke.sgml +++ b/doc/src/sgml/ref/revoke.sgml @@ -1,5 +1,5 @@ @@ -35,7 +35,7 @@ REVOKE [ GRANT OPTION FOR ] REVOKE [ GRANT OPTION FOR ] { EXECUTE | ALL [ PRIVILEGES ] } - ON FUNCTION funcname ([type, ...]) [, ...] + ON FUNCTION funcname ( [ [ argmode ] [ argname ] argtype [, ...] ] ) [, ...] FROM { username | GROUP groupname | PUBLIC } [, ...] [ CASCADE | RESTRICT ]