1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-05 09:19:17 +03:00

Update sequence docs.

This commit is contained in:
Bruce Momjian 2005-10-03 02:46:43 +00:00
parent f20cad7870
commit f890004cc1

View File

@ -1,5 +1,5 @@
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/release.sgml,v 1.383 2005/10/03 02:21:16 momjian Exp $ $PostgreSQL: pgsql/doc/src/sgml/release.sgml,v 1.384 2005/10/03 02:46:43 momjian Exp $
Typical markup: Typical markup:
@ -398,28 +398,28 @@ pg_[A-Za-z0-9_] <application>
</para> </para>
<para> <para>
In previous releases, <function>nextval()</>, In previous releases, <function>nextval()</>,
<function>currval</>, and <function>setval()</> recorded <function>currval</>, and <function>setval()</> recorded sequence
sequence names as simple text strings, meaning that renaming or names as simple text strings, meaning that renaming or dropping a
dropping a sequence used in a <command>DEFAULT</> made the sequence used in a <command>DEFAULT</> clause made the clause
clause invalid. This release stores all newly-created sequence invalid. This release stores all newly-created sequence function
function arguments using internal OIDs, allowing them to handle arguments as internal OIDs, allowing them to handle sequence
sequence renaming, and adding dependency information that renaming, and adding dependency information that prevents
prevents improper sequence removal. It also makes improper sequence removal. It also makes <command>DEFAULT</>
<command>DEFAULT</> clauses immune to schema search clauses immune to schema search path changes, and allows schema
path changes. renaming.
</para> </para>
<para> <para>
Some applications might rely on the old text-based behavior of Some applications might rely on the old text-based behavior of
run-time lookup of the sequence name. This can still be done by run-time lookup for sequence names. This can still be done by
casting the argument to <type>text</>, for example casting the argument to <type>text</>, for example
<literal>nextval('myseq'::text)</>. <literal>nextval('myseq'::text)</>.
</para> </para>
<para> <para>
Pre-8.1 schemas loaded into 8.1 will use the previous, text-based Pre-8.1 schemas loaded into 8.1 will use the previous, text-based
representation and therefore will not have these protections. representation and therefore will not have the features of
However, it is possible to upgrade a database to the newer OID-stored arguments. However, it is possible to upgrade a
OID-based arguments. First, save this query into a file, such as database loaded with pre-8.1 schemas. First, save this query into
<filename>fixseq.sql</>: a file, such as <filename>fixseq.sql</>:
<programlisting> <programlisting>
SELECT 'ALTER TABLE ' || SELECT 'ALTER TABLE ' ||
pg_catalog.quote_ident(n.nspname) || '.' || pg_catalog.quote_ident(n.nspname) || '.' ||