From: Justin Pryzby Date: Tue, 2 Apr 2019 19:13:55 -0500 Subject: [PATCH v2] Cleanup/remove/update references to OID column... ..in wake of 578b229718e8f. See also 93507e67c9ca54026019ebec3026de35d30370f9 1464755fc490a9911214817fe83077a3689250ab Reviewed-by: Daniel Verite --- doc/src/sgml/catalogs.sgml | 2 +- doc/src/sgml/ddl.sgml | 12 +++++------- doc/src/sgml/information_schema.sgml | 4 ++-- doc/src/sgml/ref/create_trigger.sgml | 2 +- doc/src/sgml/ref/insert.sgml | 12 +++++------- doc/src/sgml/ref/psql-ref.sgml | 3 +++ doc/src/sgml/spi.sgml | 2 +- 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 40ddec4..d544e60 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 9e761db..244d5ce 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. @@ -3672,11 +3671,10 @@ VALUES ('Albany', NULL, NULL, 'NY'); Partitions cannot have columns that are not present in the parent. It is not possible to specify columns when creating partitions with - 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. + CREATE TABLE, to add columns to + partitions after-the-fact using ALTER TABLE, nor to + add a partition with ALTER TABLE ... ATTACH PARTITION + if its columns would not exactly match those of the parent. diff --git a/doc/src/sgml/information_schema.sgml b/doc/src/sgml/information_schema.sgml index 1321ade..9c618b1 100644 --- a/doc/src/sgml/information_schema.sgml +++ b/doc/src/sgml/information_schema.sgml @@ -1312,8 +1312,8 @@ 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 - shown that the current user has access to (by way of being the + (ctid, etc.) are not included. The only columns shown + are those to which the current user has access (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 6456105..3339a4b 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 62e142f..3e1be4c 100644 --- a/doc/src/sgml/ref/insert.sgml +++ b/doc/src/sgml/ref/insert.sgml @@ -552,13 +552,11 @@ INSERT INTO table_name [ AS 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. + number of rows inserted or updated. + oid used to be the object ID of the inserted row + if rows was 1 and the target table had OIDs, but + OIDs system columns are not supported anymore; therefore + oid is always 0. diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 08f4bab..0e6e792 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 in user tables, and LASTOID will always be 0 + following INSERT. diff --git a/doc/src/sgml/spi.sgml b/doc/src/sgml/spi.sgml index 9b2f516..66eced6 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 -- 2.1.4 --dFWYt1i2NyOo1oI9--