Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ae875d3

Browse files
committed
Update documentation for pg_get_serial_sequence() function.
1 parent a635c08 commit ae875d3

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

doc/src/sgml/func.sgml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.353 2007/01/29 13:24:30 petere Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.354 2007/01/30 02:39:27 momjian Exp $ -->
22

33
<chapter id="functions">
44
<title>Functions and Operators</title>
@@ -9892,12 +9892,18 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
98929892
</para>
98939893

98949894
<para>
9895-
<function>pg_get_serial_sequence</function> fetches the name of the
9896-
sequence associated with a column, or NULL if there is no sequence
9897-
associated with the column. The result is suitably formatted for passing
9898-
to the sequence functions (see <xref linkend="functions-sequence">).
9899-
This association can be modified or removed with <command>ALTER SEQUENCE
9900-
OWNED BY</>. (The function probably should have been called
9895+
<function>pg_get_serial_sequence</function> returns the name of the
9896+
sequence associated with a column, or NULL if no sequence is associated
9897+
with the column. The first input parameter is a table name with
9898+
optional schema, and the second parameter is a column name. Because
9899+
the first parameter is potentially a schema and table, it is not treated
9900+
as a double-quoted identifier, meaning it is lowercased by default,
9901+
while the second parameter, being just a column name, is treated as
9902+
double-quoted and has its case preserved. The function returns a value
9903+
suitably formatted for passing to the sequence functions (see <xref
9904+
linkend="functions-sequence">). This association can be modified or
9905+
removed with <command>ALTER SEQUENCE OWNED BY</>. (The function
9906+
probably should have been called
99019907
<function>pg_get_owned_sequence</function>; its name reflects the fact
99029908
that it's typically used with <type>serial</> or <type>bigserial</>
99039909
columns.)

src/backend/utils/adt/ruleutils.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.246 2007/01/25 04:17:46 momjian Exp $
12+
* $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.247 2007/01/30 02:39:27 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -1265,6 +1265,8 @@ pg_get_userbyid(PG_FUNCTION_ARGS)
12651265
* pg_get_serial_sequence
12661266
* Get the name of the sequence used by a serial column,
12671267
* formatted suitably for passing to setval, nextval or currval.
1268+
* First parameter is not treated as double-quoted, second parameter
1269+
* is --- see documentation for reason.
12681270
*/
12691271
Datum
12701272
pg_get_serial_sequence(PG_FUNCTION_ARGS)

0 commit comments

Comments
 (0)