aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2005-03-13 09:36:31 +0000
committerNeil Conway <neilc@samurai.com>2005-03-13 09:36:31 +0000
commitff02d0a05280e96e0b91b97ec50e98611f9c7598 (patch)
tree430a642c7e87e1585db184183a4f0ce523412ef6
parent0edc2f14e0b5ece995a5ebb7f36ea593d730c4aa (diff)
downloadpostgresql-ff02d0a05280e96e0b91b97ec50e98611f9c7598.tar.gz
postgresql-ff02d0a05280e96e0b91b97ec50e98611f9c7598.zip
Make default_with_oids default to false -- user-created tables will now
no longer include OIDs, unless WITH OIDS is specified or the default_with_oids configuration parameter is enabled. Update the docs accordingly.
-rw-r--r--doc/src/sgml/datatype.sgml37
-rw-r--r--doc/src/sgml/ddl.sgml11
-rw-r--r--doc/src/sgml/plpgsql.sgml5
-rw-r--r--doc/src/sgml/pltcl.sgml7
-rw-r--r--doc/src/sgml/ref/select_into.sgml17
-rw-r--r--doc/src/sgml/runtime.sgml31
-rw-r--r--src/backend/utils/misc/guc.c8
-rw-r--r--src/backend/utils/misc/postgresql.conf.sample2
8 files changed, 48 insertions, 70 deletions
diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index 3794aa2f786..5ca2ab2f61b 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.155 2005/01/22 22:56:35 momjian Exp $
+$PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.156 2005/03/13 09:36:30 neilc Exp $
-->
<chapter id="datatype">
@@ -2980,12 +2980,12 @@ SELECT * FROM test;
<para>
Object identifiers (OIDs) are used internally by
<productname>PostgreSQL</productname> as primary keys for various
- system tables. An OID system column is also added to user-created
- tables, unless <literal>WITHOUT OIDS</literal> is specified when
- the table is created, or the <xref linkend="guc-default-with-oids">
- configuration variable is set to false. Type <type>oid</>
- represents an object identifier. There are also several alias
- types for <type>oid</>: <type>regproc</>, <type>regprocedure</>,
+ system tables. OIDs are not added to user-created tables, unless
+ <literal>WITH OIDS</literal> is specified when the table is
+ created, or the <xref linkend="guc-default-with-oids">
+ configuration variable is enabled. Type <type>oid</> represents
+ an object identifier. There are also several alias types for
+ <type>oid</>: <type>regproc</>, <type>regprocedure</>,
<type>regoper</>, <type>regoperator</>, <type>regclass</>, and
<type>regtype</>. <xref linkend="datatype-oid-table"> shows an
overview.
@@ -3000,28 +3000,11 @@ SELECT * FROM test;
references to system tables.
</para>
- <note>
- <para>
- OIDs are included by default in user-created tables in
- <productname>PostgreSQL</productname> &version;. However, this
- behavior is likely to change in a future version of
- <productname>PostgreSQL</productname>. Eventually, user-created
- tables will not include an OID system column unless <literal>WITH
- OIDS</literal> is specified when the table is created, or the
- <varname>default_with_oids</varname> configuration variable is set
- to true. If your application requires the presence of an OID
- system column in a table, it should specify <literal>WITH
- OIDS</literal> when that table is created to ensure compatibility
- with future releases of <productname>PostgreSQL</productname>.
- </para>
- </note>
-
<para>
The <type>oid</> type itself has few operations beyond comparison.
- It can be cast to
- integer, however, and then manipulated using the standard integer
- operators. (Beware of possible signed-versus-unsigned confusion
- if you do this.)
+ It can be cast to integer, however, and then manipulated using the
+ standard integer operators. (Beware of possible
+ signed-versus-unsigned confusion if you do this.)
</para>
<para>
diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml
index 2de8888254f..b0d413bbea8 100644
--- a/doc/src/sgml/ddl.sgml
+++ b/doc/src/sgml/ddl.sgml
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/ddl.sgml,v 1.39 2005/01/22 22:56:35 momjian Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/ddl.sgml,v 1.40 2005/03/13 09:36:30 neilc Exp $ -->
<chapter id="ddl">
<title>Data Definition</title>
@@ -868,11 +868,10 @@ CREATE TABLE order_items (
<primary>OID</primary>
<secondary>column</secondary>
</indexterm>
- The object identifier (object ID) of a row. This is a serial
- number that is automatically added by
- <productname>PostgreSQL</productname> to all table rows (unless
- the table was created using <literal>WITHOUT OIDS</literal>, in which
- case this column is not present). This column is of type
+ The object identifier (object ID) of a row. This column is only
+ present if the table was created using <literal>WITH
+ OIDS</literal>, or if the <xref linkend="guc-default-with-oids">
+ configuration variable was enabled. This column is of type
<type>oid</type> (same name as the column); see <xref
linkend="datatype-oid"> for more information about the type.
</para>
diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml
index 6284b793b0c..77924fd5698 100644
--- a/doc/src/sgml/plpgsql.sgml
+++ b/doc/src/sgml/plpgsql.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.61 2005/02/14 00:54:26 neilc Exp $
+$PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.62 2005/03/13 09:36:30 neilc Exp $
-->
<chapter id="plpgsql">
@@ -1299,7 +1299,8 @@ GET DIAGNOSTICS <replaceable>variable</replaceable> = <replaceable>item</replace
the <acronym>SQL</acronym> engine, and <varname>RESULT_OID</>,
the OID of the last row inserted by the most recent
<acronym>SQL</acronym> command. Note that <varname>RESULT_OID</>
- is only useful after an <command>INSERT</command> command.
+ is only useful after an <command>INSERT</command> command into a
+ table containing OIDs.
</para>
<para>
diff --git a/doc/src/sgml/pltcl.sgml b/doc/src/sgml/pltcl.sgml
index 1d22035fa9b..7cb60a3c581 100644
--- a/doc/src/sgml/pltcl.sgml
+++ b/doc/src/sgml/pltcl.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/pltcl.sgml,v 2.34 2005/01/22 22:56:36 momjian Exp $
+$PostgreSQL: pgsql/doc/src/sgml/pltcl.sgml,v 2.35 2005/03/13 09:36:30 neilc Exp $
-->
<chapter id="pltcl">
@@ -400,8 +400,9 @@ $$ LANGUAGE pltcl;
<listitem>
<para>
Returns the OID of the row inserted by the last
- <function>spi_exec</> or <function>spi_execp</>,
- if the command was a single-row <command>INSERT</>. (If not, you get zero.)
+ <function>spi_exec</> or <function>spi_execp</>, if the
+ command was a single-row <command>INSERT</> and the modified
+ table contained OIDs. (If not, you get zero.)
</para>
</listitem>
</varlistentry>
diff --git a/doc/src/sgml/ref/select_into.sgml b/doc/src/sgml/ref/select_into.sgml
index 11389d190b4..9198a02e4c4 100644
--- a/doc/src/sgml/ref/select_into.sgml
+++ b/doc/src/sgml/ref/select_into.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/select_into.sgml,v 1.33 2005/01/09 05:57:45 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/select_into.sgml,v 1.34 2005/03/13 09:36:31 neilc Exp $
PostgreSQL documentation
-->
@@ -94,14 +94,13 @@ SELECT [ ALL | DISTINCT [ ON ( <replaceable class="PARAMETER">expression</replac
</para>
<para>
- Prior to <productname>PostgreSQL</> 8.0, the table created by
- <command>SELECT INTO</command> always included OIDs.
- As of <productname>PostgreSQL</> 8.0, the
- inclusion of OIDs in the table created by <command>SELECT
- INTO</command> is controlled by the
- <xref linkend="guc-default-with-oids"> configuration variable. This
- variable currently defaults to true, but will likely default to
- false in a future release of <productname>PostgreSQL</>.
+ Prior to <productname>PostgreSQL</> 8.1, the table created by
+ <command>SELECT INTO</command> included OIDs by default. In
+ <productname>PostgreSQL</productname> 8.1, this is not the case
+ &mdash; to include OIDs in the new table, the <xref
+ linkend="guc-default-with-oids"> configuration variable must be
+ enabled. Alternatively, <command>CREATE TABLE AS</command> can be
+ used with the <literal>WITH OIDS</literal> clause.
</para>
</refsect1>
diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml
index 5ba8b9b2b3c..3517dd58d07 100644
--- a/doc/src/sgml/runtime.sgml
+++ b/doc/src/sgml/runtime.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.307 2005/03/04 20:21:05 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.308 2005/03/13 09:36:30 neilc Exp $
-->
<chapter Id="runtime">
@@ -3587,23 +3587,18 @@ dynamic_library_path = 'C:\tools\postgresql;H:\my_project\lib;$libdir'
newly-created tables, if neither <literal>WITH OIDS</literal>
nor <literal>WITHOUT OIDS</literal> is specified. It also
determines whether OIDs will be included in tables created by
- <command>SELECT INTO</command>. In
- <productname>PostgreSQL</productname> &version;
- <varname>default_with_oids</varname> defaults to true. This is
- also the behavior of previous versions of
- <productname>PostgreSQL</productname>. However, assuming that
- tables will contain OIDs by default is not encouraged. This
- option will probably default to false in a future release of
- <productname>PostgreSQL</productname>.
- </para>
-
- <para>
- To ease compatibility with applications that make use of OIDs,
- this option should left enabled. To ease compatibility with
- future versions of <productname>PostgreSQL</productname>, this
- option should be disabled, and applications that require OIDs
- on certain tables should explicitly specify <literal>WITH
- OIDS</literal> when those tables are created.
+ <command>SELECT INTO</command>. In <productname>PostgreSQL</>
+ 8.1 <varname>default_with_oids</> is disabled by default; in
+ prior versions of PostgreSQL, it was true by default.
+ </para>
+
+ <para>
+ The use of OIDs in user tables is considered deprecated, so
+ most installations should leave this variable disabled.
+ Applications that require OIDs for a particular table should
+ specify <literal>WITH OIDS</literal> when creating the
+ table. This variable can be enabled for compatibility with old
+ applications that do not follow this behavior.
</para>
</listitem>
</varlistentry>
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index b9486e86638..67374a4b61f 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.254 2005/03/04 20:21:06 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.255 2005/03/13 09:36:31 neilc Exp $
*
*--------------------------------------------------------------------
*/
@@ -139,7 +139,7 @@ bool Australian_timezones = false;
bool Password_encryption = true;
-bool default_with_oids = true;
+bool default_with_oids = false;
int log_min_error_statement = PANIC;
int log_min_messages = NOTICE;
@@ -801,11 +801,11 @@ static struct config_bool ConfigureNamesBool[] =
},
{
{"default_with_oids", PGC_USERSET, COMPAT_OPTIONS_PREVIOUS,
- gettext_noop("By default, newly-created tables should have OIDs."),
+ gettext_noop("Create new tables with OIDs by default."),
NULL
},
&default_with_oids,
- true, NULL, NULL
+ false, NULL, NULL
},
{
{"redirect_stderr", PGC_POSTMASTER, LOGGING_WHERE,
diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample
index 74a029e6574..070d1e7632e 100644
--- a/src/backend/utils/misc/postgresql.conf.sample
+++ b/src/backend/utils/misc/postgresql.conf.sample
@@ -314,7 +314,7 @@
#add_missing_from = true
#regex_flavor = advanced # advanced, extended, or basic
#sql_inheritance = true
-#default_with_oids = true
+#default_with_oids = false
# - Other Platforms & Clients -