From f6b39171f3d65155b9390c2c69bc5b3469f923a8 Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Wed, 17 Apr 2019 17:22:56 -0700 Subject: [PATCH] docs: cleanup/remove/update references to OID column. I (Andres) missed these in 578b229718e8f. Author: Justin Pryzby, editorialized a bit by Andres Freund Reviewed-By: Daniel Verite, Andres Freund Discussion: https://postgr.es/m/20190408002847.GA904@telsasoft.com --- doc/src/sgml/catalogs.sgml | 2 +- doc/src/sgml/ddl.sgml | 6 ++---- doc/src/sgml/information_schema.sgml | 2 +- doc/src/sgml/ref/create_trigger.sgml | 2 +- doc/src/sgml/ref/insert.sgml | 14 ++++++-------- doc/src/sgml/ref/psql-ref.sgml | 3 +++ doc/src/sgml/spi.sgml | 2 +- 7 files changed, 15 insertions(+), 16 deletions(-) diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 17018637f1..4c7e93892a 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -1047,7 +1047,7 @@ The number of the column. Ordinary columns are numbered from 1 - up. System columns, such as oid, + up. System columns, such as ctid, have (arbitrary) negative numbers. diff --git a/doc/src/sgml/ddl.sgml b/doc/src/sgml/ddl.sgml index 1fe27c5da9..cba2ea9b2b 100644 --- a/doc/src/sgml/ddl.sgml +++ b/doc/src/sgml/ddl.sgml @@ -1202,8 +1202,7 @@ CREATE TABLE circles ( ctid will change if it is updated or moved by VACUUM FULL. Therefore ctid is useless as a long-term row - identifier. The OID, or even better a user-defined serial - number, should be used to identify logical rows. + identifier. A primary key should be used to identify logical rows. @@ -3675,8 +3674,7 @@ VALUES ('Albany', NULL, NULL, 'NY'); CREATE TABLE, nor is it possible to add columns to partitions after-the-fact using ALTER TABLE. Tables may be added as a partition with ALTER TABLE ... ATTACH PARTITION - only if their columns exactly match the parent, including any - oid column. + only if their columns exactly match the parent. diff --git a/doc/src/sgml/information_schema.sgml b/doc/src/sgml/information_schema.sgml index 1321ade44a..234a3bb6d1 100644 --- a/doc/src/sgml/information_schema.sgml +++ b/doc/src/sgml/information_schema.sgml @@ -1312,7 +1312,7 @@ The view columns contains information about all table columns (or view columns) in the database. System columns - (oid, etc.) are not included. Only those columns are + (ctid, etc.) are not included. Only those columns are shown that the current user has access to (by way of being the owner or having some privilege). diff --git a/doc/src/sgml/ref/create_trigger.sgml b/doc/src/sgml/ref/create_trigger.sgml index 6456105de6..3339a4b4e1 100644 --- a/doc/src/sgml/ref/create_trigger.sgml +++ b/doc/src/sgml/ref/create_trigger.sgml @@ -465,7 +465,7 @@ UPDATE OF column_name1 [, column_name2NEW row seen by the condition is the current value, as possibly modified by earlier triggers. Also, a BEFORE trigger's WHEN condition is not allowed to examine the - system columns of the NEW row (such as oid), + system columns of the NEW row (such as ctid), because those won't have been set yet. diff --git a/doc/src/sgml/ref/insert.sgml b/doc/src/sgml/ref/insert.sgml index 62e142fd8e..189ce2a0ca 100644 --- a/doc/src/sgml/ref/insert.sgml +++ b/doc/src/sgml/ref/insert.sgml @@ -551,14 +551,12 @@ INSERT INTO table_name [ AS INSERT oid count - The count is the - number of rows inserted or updated. If count is exactly one, and the - target table has OIDs, then oid is the OID - assigned to the inserted row. The single row must have been - inserted rather than updated. Otherwise oid is zero. + The count is the number of + rows inserted or updated. oid is always 0 (it + used to be the OID assigned to the inserted row if + rows was exactly one and the target table was + declared WITH OIDS and 0 otherwise, but creating a table + WITH OIDS is not supported anymore). diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index d5441a9e41..b86764003d 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -3794,6 +3794,9 @@ bar command. This variable is only guaranteed to be valid until after the result of the next SQL command has been displayed. + PostgreSQL servers since version 12 do not + support OID system columns anymore, thus LASTOID will always be 0 + following INSERT when targeting such servers. diff --git a/doc/src/sgml/spi.sgml b/doc/src/sgml/spi.sgml index 9b2f516942..66eced6c94 100644 --- a/doc/src/sgml/spi.sgml +++ b/doc/src/sgml/spi.sgml @@ -3105,7 +3105,7 @@ int SPI_fnumber(TupleDesc rowdesc, const char * If colname refers to a system column (e.g., - oid) then the appropriate negative column number will + ctid) then the appropriate negative column number will be returned. The caller should be careful to test the return value for exact equality to SPI_ERROR_NOATTRIBUTE to detect an error; testing the result for less than or equal to 0 is