aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2007-01-30 02:39:27 +0000
committerBruce Momjian <bruce@momjian.us>2007-01-30 02:39:27 +0000
commitae875d318ec160cc0042e17560254928a5ed863c (patch)
tree49969a299561b39a4055ba3072a04e74747edb79
parenta635c08fa10fe545d723bcec6eb73bfdca07e2c0 (diff)
downloadpostgresql-ae875d318ec160cc0042e17560254928a5ed863c.tar.gz
postgresql-ae875d318ec160cc0042e17560254928a5ed863c.zip
Update documentation for pg_get_serial_sequence() function.
-rw-r--r--doc/src/sgml/func.sgml20
-rw-r--r--src/backend/utils/adt/ruleutils.c4
2 files changed, 16 insertions, 8 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 4b03b4df148..87a4ce48dec 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.353 2007/01/29 13:24:30 petere Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.354 2007/01/30 02:39:27 momjian Exp $ -->
<chapter id="functions">
<title>Functions and Operators</title>
@@ -9892,12 +9892,18 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
</para>
<para>
- <function>pg_get_serial_sequence</function> fetches the name of the
- sequence associated with a column, or NULL if there is no sequence
- associated with the column. The result is suitably formatted for passing
- to the sequence functions (see <xref linkend="functions-sequence">).
- This association can be modified or removed with <command>ALTER SEQUENCE
- OWNED BY</>. (The function probably should have been called
+ <function>pg_get_serial_sequence</function> returns the name of the
+ sequence associated with a column, or NULL if no sequence is associated
+ with the column. The first input parameter is a table name with
+ optional schema, and the second parameter is a column name. Because
+ the first parameter is potentially a schema and table, it is not treated
+ as a double-quoted identifier, meaning it is lowercased by default,
+ while the second parameter, being just a column name, is treated as
+ double-quoted and has its case preserved. The function returns a value
+ suitably formatted for passing to the sequence functions (see <xref
+ linkend="functions-sequence">). This association can be modified or
+ removed with <command>ALTER SEQUENCE OWNED BY</>. (The function
+ probably should have been called
<function>pg_get_owned_sequence</function>; its name reflects the fact
that it's typically used with <type>serial</> or <type>bigserial</>
columns.)
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 5222fd3a602..668266d1c4d 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.246 2007/01/25 04:17:46 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.247 2007/01/30 02:39:27 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1265,6 +1265,8 @@ pg_get_userbyid(PG_FUNCTION_ARGS)
* pg_get_serial_sequence
* Get the name of the sequence used by a serial column,
* formatted suitably for passing to setval, nextval or currval.
+ * First parameter is not treated as double-quoted, second parameter
+ * is --- see documentation for reason.
*/
Datum
pg_get_serial_sequence(PG_FUNCTION_ARGS)