diff options
Diffstat (limited to 'src/include')
89 files changed, 160 insertions, 131 deletions
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index 40e153f71ad..64cfdbd2f06 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -151,7 +151,7 @@ extern BulkInsertState GetBulkInsertState(void); extern void FreeBulkInsertState(BulkInsertState); extern void ReleaseBulkInsertStatePin(BulkInsertState bistate); -extern Oid heap_insert(Relation relation, HeapTuple tup, CommandId cid, +extern void heap_insert(Relation relation, HeapTuple tup, CommandId cid, int options, BulkInsertState bistate); extern void heap_multi_insert(Relation relation, HeapTuple *tuples, int ntuples, CommandId cid, int options, BulkInsertState bistate); @@ -176,7 +176,7 @@ extern bool heap_tuple_needs_freeze(HeapTupleHeader tuple, TransactionId cutoff_ MultiXactId cutoff_multi, Buffer buf); extern bool heap_tuple_needs_eventual_freeze(HeapTupleHeader tuple); -extern Oid simple_heap_insert(Relation relation, HeapTuple tup); +extern void simple_heap_insert(Relation relation, HeapTuple tup); extern void simple_heap_delete(Relation relation, ItemPointer tid); extern void simple_heap_update(Relation relation, ItemPointer otid, HeapTuple tup); diff --git a/src/include/access/htup_details.h b/src/include/access/htup_details.h index 1867a70f6f3..708f73f0ea0 100644 --- a/src/include/access/htup_details.h +++ b/src/include/access/htup_details.h @@ -65,7 +65,8 @@ * fixed fields (HeapTupleHeaderData struct) * nulls bitmap (if HEAP_HASNULL is set in t_infomask) * alignment padding (as needed to make user data MAXALIGN'd) - * object ID (if HEAP_HASOID is set in t_infomask) + * object ID (if HEAP_HASOID_OLD is set in t_infomask, not created + * anymore) * user data fields * * We store five "virtual" fields Xmin, Cmin, Xmax, Cmax, and Xvac in three @@ -188,7 +189,7 @@ struct HeapTupleHeaderData #define HEAP_HASNULL 0x0001 /* has null attribute(s) */ #define HEAP_HASVARWIDTH 0x0002 /* has variable-width attribute(s) */ #define HEAP_HASEXTERNAL 0x0004 /* has external stored attribute(s) */ -#define HEAP_HASOID 0x0008 /* has an object-id field */ +#define HEAP_HASOID_OLD 0x0008 /* has an object-id field */ #define HEAP_XMAX_KEYSHR_LOCK 0x0010 /* xmax is a key-shared locker */ #define HEAP_COMBOCID 0x0020 /* t_cid is a combo cid */ #define HEAP_XMAX_EXCL_LOCK 0x0040 /* xmax is exclusive locker */ @@ -474,20 +475,6 @@ do { \ (tup)->t_choice.t_datum.datum_typmod = (typmod) \ ) -#define HeapTupleHeaderGetOid(tup) \ -( \ - ((tup)->t_infomask & HEAP_HASOID) ? \ - *((Oid *) ((char *)(tup) + (tup)->t_hoff - sizeof(Oid))) \ - : \ - InvalidOid \ -) - -#define HeapTupleHeaderSetOid(tup, oid) \ -do { \ - Assert((tup)->t_infomask & HEAP_HASOID); \ - *((Oid *) ((char *)(tup) + (tup)->t_hoff - sizeof(Oid))) = (oid); \ -} while (0) - /* * Note that we stop considering a tuple HOT-updated as soon as it is known * aborted or the would-be updating transaction is known aborted. For best @@ -704,12 +691,6 @@ struct MinimalTupleData #define HeapTupleClearHeapOnly(tuple) \ HeapTupleHeaderClearHeapOnly((tuple)->t_data) -#define HeapTupleGetOid(tuple) \ - HeapTupleHeaderGetOid((tuple)->t_data) - -#define HeapTupleSetOid(tuple, oid) \ - HeapTupleHeaderSetOid((tuple)->t_data, (oid)) - /* ---------------- * fastgetattr diff --git a/src/include/access/reloptions.h b/src/include/access/reloptions.h index 4022c14a830..50690b9c9e0 100644 --- a/src/include/access/reloptions.h +++ b/src/include/access/reloptions.h @@ -258,7 +258,7 @@ extern void add_string_reloption(bits32 kinds, const char *name, const char *des extern Datum transformRelOptions(Datum oldOptions, List *defList, const char *namspace, char *validnsps[], - bool ignoreOids, bool isReset); + bool acceptOidsOff, bool isReset); extern List *untransformRelOptions(Datum options); extern bytea *extractRelOptions(HeapTuple tuple, TupleDesc tupdesc, amoptions_function amoptions); diff --git a/src/include/access/sysattr.h b/src/include/access/sysattr.h index c6f244011ab..8a0d4d17d1b 100644 --- a/src/include/access/sysattr.h +++ b/src/include/access/sysattr.h @@ -19,12 +19,11 @@ * Attribute numbers for the system-defined attributes */ #define SelfItemPointerAttributeNumber (-1) -#define ObjectIdAttributeNumber (-2) -#define MinTransactionIdAttributeNumber (-3) -#define MinCommandIdAttributeNumber (-4) -#define MaxTransactionIdAttributeNumber (-5) -#define MaxCommandIdAttributeNumber (-6) -#define TableOidAttributeNumber (-7) -#define FirstLowInvalidHeapAttributeNumber (-8) +#define MinTransactionIdAttributeNumber (-2) +#define MinCommandIdAttributeNumber (-3) +#define MaxTransactionIdAttributeNumber (-4) +#define MaxCommandIdAttributeNumber (-5) +#define TableOidAttributeNumber (-6) +#define FirstLowInvalidHeapAttributeNumber (-7) #endif /* SYSATTR_H */ diff --git a/src/include/access/tupdesc.h b/src/include/access/tupdesc.h index 708160f645e..06af39ff2a3 100644 --- a/src/include/access/tupdesc.h +++ b/src/include/access/tupdesc.h @@ -55,7 +55,7 @@ typedef struct tupleConstr * structure is designed to let the constraints be omitted efficiently. * * Note that only user attributes, not system attributes, are mentioned in - * TupleDesc; with the exception that tdhasoid indicates if OID is present. + * TupleDesc. * * If the tupdesc is known to correspond to a named rowtype (such as a table's * rowtype) then tdtypeid identifies that type and tdtypmod is -1. Otherwise @@ -82,7 +82,6 @@ typedef struct tupleDesc int natts; /* number of attributes in the tuple */ Oid tdtypeid; /* composite type ID for tuple type */ int32 tdtypmod; /* typmod for tuple type */ - bool tdhasoid; /* tuple has oid attribute in its header */ int tdrefcount; /* reference count, or -1 if not counting */ TupleConstr *constr; /* constraints, or NULL if none */ /* attrs[N] is the description of Attribute Number N+1 */ @@ -92,10 +91,9 @@ typedef struct tupleDesc /* Accessor for the i'th attribute of tupdesc. */ #define TupleDescAttr(tupdesc, i) (&(tupdesc)->attrs[(i)]) -extern TupleDesc CreateTemplateTupleDesc(int natts, bool hasoid); +extern TupleDesc CreateTemplateTupleDesc(int natts); -extern TupleDesc CreateTupleDesc(int natts, bool hasoid, - Form_pg_attribute *attrs); +extern TupleDesc CreateTupleDesc(int natts, Form_pg_attribute *attrs); extern TupleDesc CreateTupleDescCopy(TupleDesc tupdesc); diff --git a/src/include/bootstrap/bootstrap.h b/src/include/bootstrap/bootstrap.h index 7856669ff91..1f592aa7f85 100644 --- a/src/include/bootstrap/bootstrap.h +++ b/src/include/bootstrap/bootstrap.h @@ -40,7 +40,7 @@ extern void closerel(char *name); extern void boot_openrel(char *name); extern void DefineAttr(char *name, char *type, int attnum, int nullness); -extern void InsertOneTuple(Oid objectid); +extern void InsertOneTuple(void); extern void InsertOneValue(char *value, int i); extern void InsertOneNull(int i); diff --git a/src/include/catalog/catalog.h b/src/include/catalog/catalog.h index 197e77f7f4f..2f351700b40 100644 --- a/src/include/catalog/catalog.h +++ b/src/include/catalog/catalog.h @@ -33,7 +33,6 @@ extern bool IsReservedName(const char *name); extern bool IsSharedRelation(Oid relationId); -extern Oid GetNewOid(Relation relation); extern Oid GetNewOidWithIndex(Relation relation, Oid indexId, AttrNumber oidcolumn); extern Oid GetNewRelFileNode(Oid reltablespace, Relation pg_class, diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index a307a2ba767..be72bddd17c 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 201811141 +#define CATALOG_VERSION_NO 201811201 #endif diff --git a/src/include/catalog/genbki.h b/src/include/catalog/genbki.h index 8a4277b7c87..c6a7feac24a 100644 --- a/src/include/catalog/genbki.h +++ b/src/include/catalog/genbki.h @@ -25,7 +25,6 @@ /* Options that may appear after CATALOG (on the same line) */ #define BKI_BOOTSTRAP #define BKI_SHARED_RELATION -#define BKI_WITHOUT_OIDS #define BKI_ROWTYPE_OID(oid,oidmacro) #define BKI_SCHEMA_MACRO diff --git a/src/include/catalog/heap.h b/src/include/catalog/heap.h index 39f04b06eef..56a341a6222 100644 --- a/src/include/catalog/heap.h +++ b/src/include/catalog/heap.h @@ -65,8 +65,6 @@ extern Oid heap_create_with_catalog(const char *relname, char relpersistence, bool shared_relation, bool mapped_relation, - bool oidislocal, - int oidinhcount, OnCommitAction oncommit, Datum reloptions, bool use_user_acl, @@ -127,11 +125,9 @@ extern void RemoveAttrDefault(Oid relid, AttrNumber attnum, extern void RemoveAttrDefaultById(Oid attrdefId); extern void RemoveStatistics(Oid relid, AttrNumber attnum); -extern const FormData_pg_attribute *SystemAttributeDefinition(AttrNumber attno, - bool relhasoids); +extern const FormData_pg_attribute *SystemAttributeDefinition(AttrNumber attno); -extern const FormData_pg_attribute *SystemAttributeByName(const char *attname, - bool relhasoids); +extern const FormData_pg_attribute *SystemAttributeByName(const char *attname); extern void CheckAttributeNamesTypes(TupleDesc tupdesc, char relkind, bool allow_system_table_mods); diff --git a/src/include/catalog/indexing.h b/src/include/catalog/indexing.h index 254fbef1f78..2359b4c6291 100644 --- a/src/include/catalog/indexing.h +++ b/src/include/catalog/indexing.h @@ -30,8 +30,8 @@ typedef struct ResultRelInfo *CatalogIndexState; */ extern CatalogIndexState CatalogOpenIndexes(Relation heapRel); extern void CatalogCloseIndexes(CatalogIndexState indstate); -extern Oid CatalogTupleInsert(Relation heapRel, HeapTuple tup); -extern Oid CatalogTupleInsertWithInfo(Relation heapRel, HeapTuple tup, +extern void CatalogTupleInsert(Relation heapRel, HeapTuple tup); +extern void CatalogTupleInsertWithInfo(Relation heapRel, HeapTuple tup, CatalogIndexState indstate); extern void CatalogTupleUpdate(Relation heapRel, ItemPointer otid, HeapTuple tup); diff --git a/src/include/catalog/objectaddress.h b/src/include/catalog/objectaddress.h index 6a9b1eec73f..3f95733eb1a 100644 --- a/src/include/catalog/objectaddress.h +++ b/src/include/catalog/objectaddress.h @@ -58,6 +58,7 @@ extern bool is_objectclass_supported(Oid class_id); extern Oid get_object_oid_index(Oid class_id); extern int get_object_catcache_oid(Oid class_id); extern int get_object_catcache_name(Oid class_id); +extern AttrNumber get_object_attnum_oid(Oid class_id); extern AttrNumber get_object_attnum_name(Oid class_id); extern AttrNumber get_object_attnum_namespace(Oid class_id); extern AttrNumber get_object_attnum_owner(Oid class_id); @@ -66,7 +67,7 @@ extern ObjectType get_object_type(Oid class_id, Oid object_id); extern bool get_object_namensp_unique(Oid class_id); extern HeapTuple get_catalog_object_by_oid(Relation catalog, - Oid objectId); + AttrNumber oidcol, Oid objectId); extern char *getObjectDescription(const ObjectAddress *object); extern char *getObjectDescriptionOids(Oid classid, Oid objid); diff --git a/src/include/catalog/pg_aggregate.h b/src/include/catalog/pg_aggregate.h index bcae93f5e14..c88ba91401f 100644 --- a/src/include/catalog/pg_aggregate.h +++ b/src/include/catalog/pg_aggregate.h @@ -29,7 +29,7 @@ * cpp turns this into typedef struct FormData_pg_aggregate * ---------------------------------------------------------------- */ -CATALOG(pg_aggregate,2600,AggregateRelationId) BKI_WITHOUT_OIDS +CATALOG(pg_aggregate,2600,AggregateRelationId) { /* pg_proc OID of the aggregate itself */ regproc aggfnoid BKI_LOOKUP(pg_proc); diff --git a/src/include/catalog/pg_am.h b/src/include/catalog/pg_am.h index 26cb2349875..57d65f830fc 100644 --- a/src/include/catalog/pg_am.h +++ b/src/include/catalog/pg_am.h @@ -28,6 +28,8 @@ */ CATALOG(pg_am,2601,AccessMethodRelationId) { + Oid oid; /* oid */ + /* access method name */ NameData amname; diff --git a/src/include/catalog/pg_amop.h b/src/include/catalog/pg_amop.h index 8e6f7408872..f110fdd7413 100644 --- a/src/include/catalog/pg_amop.h +++ b/src/include/catalog/pg_amop.h @@ -53,6 +53,8 @@ */ CATALOG(pg_amop,2602,AccessMethodOperatorRelationId) { + Oid oid; /* oid */ + /* the index opfamily this entry is for */ Oid amopfamily BKI_LOOKUP(pg_opfamily); diff --git a/src/include/catalog/pg_amproc.h b/src/include/catalog/pg_amproc.h index c34c3faa8ff..c5f79ba5939 100644 --- a/src/include/catalog/pg_amproc.h +++ b/src/include/catalog/pg_amproc.h @@ -42,6 +42,8 @@ */ CATALOG(pg_amproc,2603,AccessMethodProcedureRelationId) { + Oid oid; /* oid */ + /* the index opfamily this entry is for */ Oid amprocfamily BKI_LOOKUP(pg_opfamily); diff --git a/src/include/catalog/pg_attrdef.h b/src/include/catalog/pg_attrdef.h index a9a2351efdd..37b439882a4 100644 --- a/src/include/catalog/pg_attrdef.h +++ b/src/include/catalog/pg_attrdef.h @@ -28,6 +28,8 @@ */ CATALOG(pg_attrdef,2604,AttrDefaultRelationId) { + Oid oid; /* oid */ + Oid adrelid; /* OID of table containing attribute */ int16 adnum; /* attnum of attribute */ diff --git a/src/include/catalog/pg_attribute.h b/src/include/catalog/pg_attribute.h index dc36753ede0..1bac59bf26e 100644 --- a/src/include/catalog/pg_attribute.h +++ b/src/include/catalog/pg_attribute.h @@ -34,7 +34,7 @@ * You may need to change catalog/genbki.pl as well. * ---------------- */ -CATALOG(pg_attribute,1249,AttributeRelationId) BKI_BOOTSTRAP BKI_WITHOUT_OIDS BKI_ROWTYPE_OID(75,AttributeRelation_Rowtype_Id) BKI_SCHEMA_MACRO +CATALOG(pg_attribute,1249,AttributeRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(75,AttributeRelation_Rowtype_Id) BKI_SCHEMA_MACRO { Oid attrelid; /* OID of relation containing this attribute */ NameData attname; /* name of attribute */ diff --git a/src/include/catalog/pg_auth_members.h b/src/include/catalog/pg_auth_members.h index 277ea89c6f2..6d93038f6cd 100644 --- a/src/include/catalog/pg_auth_members.h +++ b/src/include/catalog/pg_auth_members.h @@ -27,7 +27,7 @@ * typedef struct FormData_pg_auth_members * ---------------- */ -CATALOG(pg_auth_members,1261,AuthMemRelationId) BKI_SHARED_RELATION BKI_WITHOUT_OIDS BKI_ROWTYPE_OID(2843,AuthMemRelation_Rowtype_Id) BKI_SCHEMA_MACRO +CATALOG(pg_auth_members,1261,AuthMemRelationId) BKI_SHARED_RELATION BKI_ROWTYPE_OID(2843,AuthMemRelation_Rowtype_Id) BKI_SCHEMA_MACRO { Oid roleid; /* ID of a role */ Oid member; /* ID of a member of that role */ diff --git a/src/include/catalog/pg_authid.h b/src/include/catalog/pg_authid.h index ba482f1cb91..ee0c8da6120 100644 --- a/src/include/catalog/pg_authid.h +++ b/src/include/catalog/pg_authid.h @@ -30,6 +30,7 @@ */ CATALOG(pg_authid,1260,AuthIdRelationId) BKI_SHARED_RELATION BKI_ROWTYPE_OID(2842,AuthIdRelation_Rowtype_Id) BKI_SCHEMA_MACRO { + Oid oid; /* oid */ NameData rolname; /* name of role */ bool rolsuper; /* read this field via superuser() only! */ bool rolinherit; /* inherit privileges from other roles? */ diff --git a/src/include/catalog/pg_cast.h b/src/include/catalog/pg_cast.h index 7f4a25b2dad..dd207bf318d 100644 --- a/src/include/catalog/pg_cast.h +++ b/src/include/catalog/pg_cast.h @@ -30,6 +30,8 @@ */ CATALOG(pg_cast,2605,CastRelationId) { + Oid oid; /* oid */ + /* source datatype for cast */ Oid castsource BKI_LOOKUP(pg_type); diff --git a/src/include/catalog/pg_class.dat b/src/include/catalog/pg_class.dat index 9fffdef3790..5a884a852b5 100644 --- a/src/include/catalog/pg_class.dat +++ b/src/include/catalog/pg_class.dat @@ -25,11 +25,11 @@ reloftype => '0', relowner => 'PGUID', relam => '0', relfilenode => '0', reltablespace => '0', relpages => '0', reltuples => '0', relallvisible => '0', reltoastrelid => '0', relhasindex => 'f', relisshared => 'f', - relpersistence => 'p', relkind => 'r', relnatts => '30', relchecks => '0', - relhasoids => 't', relhasrules => 'f', relhastriggers => 'f', - relhassubclass => 'f', relrowsecurity => 'f', relforcerowsecurity => 'f', - relispopulated => 't', relreplident => 'n', relispartition => 'f', - relrewrite => '0', relfrozenxid => '3', relminmxid => '1', relacl => '_null_', + relpersistence => 'p', relkind => 'r', relnatts => '31', relchecks => '0', + relhasrules => 'f', relhastriggers => 'f', relhassubclass => 'f', + relrowsecurity => 'f', relforcerowsecurity => 'f', relispopulated => 't', + relreplident => 'n', relispartition => 'f', relrewrite => '0', + relfrozenxid => '3', relminmxid => '1', relacl => '_null_', reloptions => '_null_', relpartbound => '_null_' }, { oid => '1249', relname => 'pg_attribute', relnamespace => 'PGNSP', reltype => '75', @@ -37,21 +37,21 @@ reltablespace => '0', relpages => '0', reltuples => '0', relallvisible => '0', reltoastrelid => '0', relhasindex => 'f', relisshared => 'f', relpersistence => 'p', relkind => 'r', relnatts => '24', relchecks => '0', - relhasoids => 'f', relhasrules => 'f', relhastriggers => 'f', - relhassubclass => 'f', relrowsecurity => 'f', relforcerowsecurity => 'f', - relispopulated => 't', relreplident => 'n', relispartition => 'f', - relrewrite => '0', relfrozenxid => '3', relminmxid => '1', relacl => '_null_', + relhasrules => 'f', relhastriggers => 'f', relhassubclass => 'f', + relrowsecurity => 'f', relforcerowsecurity => 'f', relispopulated => 't', + relreplident => 'n', relispartition => 'f', relrewrite => '0', + relfrozenxid => '3', relminmxid => '1', relacl => '_null_', reloptions => '_null_', relpartbound => '_null_' }, { oid => '1255', relname => 'pg_proc', relnamespace => 'PGNSP', reltype => '81', reloftype => '0', relowner => 'PGUID', relam => '0', relfilenode => '0', reltablespace => '0', relpages => '0', reltuples => '0', relallvisible => '0', reltoastrelid => '0', relhasindex => 'f', relisshared => 'f', - relpersistence => 'p', relkind => 'r', relnatts => '28', relchecks => '0', - relhasoids => 't', relhasrules => 'f', relhastriggers => 'f', - relhassubclass => 'f', relrowsecurity => 'f', relforcerowsecurity => 'f', - relispopulated => 't', relreplident => 'n', relispartition => 'f', - relrewrite => '0', relfrozenxid => '3', relminmxid => '1', relacl => '_null_', + relpersistence => 'p', relkind => 'r', relnatts => '29', relchecks => '0', + relhasrules => 'f', relhastriggers => 'f', relhassubclass => 'f', + relrowsecurity => 'f', relforcerowsecurity => 'f', relispopulated => 't', + relreplident => 'n', relispartition => 'f', relrewrite => '0', + relfrozenxid => '3', relminmxid => '1', relacl => '_null_', reloptions => '_null_', relpartbound => '_null_' }, { oid => '1259', relname => 'pg_class', relnamespace => 'PGNSP', reltype => '83', @@ -59,10 +59,10 @@ reltablespace => '0', relpages => '0', reltuples => '0', relallvisible => '0', reltoastrelid => '0', relhasindex => 'f', relisshared => 'f', relpersistence => 'p', relkind => 'r', relnatts => '33', relchecks => '0', - relhasoids => 't', relhasrules => 'f', relhastriggers => 'f', - relhassubclass => 'f', relrowsecurity => 'f', relforcerowsecurity => 'f', - relispopulated => 't', relreplident => 'n', relispartition => 'f', - relrewrite => '0', relfrozenxid => '3', relminmxid => '1', relacl => '_null_', + relhasrules => 'f', relhastriggers => 'f', relhassubclass => 'f', + relrowsecurity => 'f', relforcerowsecurity => 'f', relispopulated => 't', + relreplident => 'n', relispartition => 'f', relrewrite => '0', + relfrozenxid => '3', relminmxid => '1', relacl => '_null_', reloptions => '_null_', relpartbound => '_null_' }, ] diff --git a/src/include/catalog/pg_class.h b/src/include/catalog/pg_class.h index 788d7a31dc0..84e63c6d06a 100644 --- a/src/include/catalog/pg_class.h +++ b/src/include/catalog/pg_class.h @@ -28,6 +28,7 @@ */ CATALOG(pg_class,1259,RelationRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(83,RelationRelation_Rowtype_Id) BKI_SCHEMA_MACRO { + Oid oid; /* oid */ NameData relname; /* class name */ Oid relnamespace; /* OID of namespace containing this class */ Oid reltype; /* OID of entry in pg_type for table's @@ -57,7 +58,6 @@ CATALOG(pg_class,1259,RelationRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(83,Relat * contain entries with negative attnums for system attributes. */ int16 relchecks; /* # of CHECK constraints for class */ - bool relhasoids; /* T if we generate OIDs for rows of rel */ bool relhasrules; /* has (or has had) any rules */ bool relhastriggers; /* has (or has had) any TRIGGERs */ bool relhassubclass; /* has (or has had) child tables or indexes */ diff --git a/src/include/catalog/pg_collation.h b/src/include/catalog/pg_collation.h index 7e0f4461c61..51f9b2a2ca4 100644 --- a/src/include/catalog/pg_collation.h +++ b/src/include/catalog/pg_collation.h @@ -28,6 +28,7 @@ */ CATALOG(pg_collation,3456,CollationRelationId) { + Oid oid; /* oid */ NameData collname; /* collation name */ Oid collnamespace; /* OID of namespace containing collation */ Oid collowner; /* owner of collation */ diff --git a/src/include/catalog/pg_constraint.h b/src/include/catalog/pg_constraint.h index 630cabe0b8f..0e4007389b6 100644 --- a/src/include/catalog/pg_constraint.h +++ b/src/include/catalog/pg_constraint.h @@ -31,6 +31,8 @@ */ CATALOG(pg_constraint,2606,ConstraintRelationId) { + Oid oid; /* oid */ + /* * conname + connamespace is deliberately not unique; we allow, for * example, the same name to be used for constraints of different diff --git a/src/include/catalog/pg_conversion.h b/src/include/catalog/pg_conversion.h index 37515f64c2f..6e8f054306f 100644 --- a/src/include/catalog/pg_conversion.h +++ b/src/include/catalog/pg_conversion.h @@ -39,6 +39,7 @@ */ CATALOG(pg_conversion,2607,ConversionRelationId) { + Oid oid; /* oid */ NameData conname; Oid connamespace; Oid conowner; diff --git a/src/include/catalog/pg_database.h b/src/include/catalog/pg_database.h index ac027b79199..f6aebad8ef0 100644 --- a/src/include/catalog/pg_database.h +++ b/src/include/catalog/pg_database.h @@ -28,6 +28,7 @@ */ CATALOG(pg_database,1262,DatabaseRelationId) BKI_SHARED_RELATION BKI_ROWTYPE_OID(1248,DatabaseRelation_Rowtype_Id) BKI_SCHEMA_MACRO { + Oid oid; /* oid */ NameData datname; /* database name */ Oid datdba; /* owner of database */ int32 encoding; /* character encoding */ diff --git a/src/include/catalog/pg_db_role_setting.h b/src/include/catalog/pg_db_role_setting.h index eff801c3ce5..96440342f28 100644 --- a/src/include/catalog/pg_db_role_setting.h +++ b/src/include/catalog/pg_db_role_setting.h @@ -31,7 +31,7 @@ * typedef struct FormData_pg_db_role_setting * ---------------- */ -CATALOG(pg_db_role_setting,2964,DbRoleSettingRelationId) BKI_SHARED_RELATION BKI_WITHOUT_OIDS +CATALOG(pg_db_role_setting,2964,DbRoleSettingRelationId) BKI_SHARED_RELATION { Oid setdatabase; /* database */ Oid setrole; /* role */ diff --git a/src/include/catalog/pg_default_acl.h b/src/include/catalog/pg_default_acl.h index aee49fdb6da..f4f8f99b3e3 100644 --- a/src/include/catalog/pg_default_acl.h +++ b/src/include/catalog/pg_default_acl.h @@ -29,6 +29,7 @@ */ CATALOG(pg_default_acl,826,DefaultAclRelationId) { + Oid oid; /* oid */ Oid defaclrole; /* OID of role owning this ACL */ Oid defaclnamespace; /* OID of namespace, or 0 for all */ char defaclobjtype; /* see DEFACLOBJ_xxx constants below */ diff --git a/src/include/catalog/pg_depend.h b/src/include/catalog/pg_depend.h index 482b8bd2516..8f2d95210fa 100644 --- a/src/include/catalog/pg_depend.h +++ b/src/include/catalog/pg_depend.h @@ -38,7 +38,7 @@ * typedef struct FormData_pg_depend * ---------------- */ -CATALOG(pg_depend,2608,DependRelationId) BKI_WITHOUT_OIDS +CATALOG(pg_depend,2608,DependRelationId) { /* * Identification of the dependent (referencing) object. diff --git a/src/include/catalog/pg_description.h b/src/include/catalog/pg_description.h index 74302bd451d..1f21a83ba2a 100644 --- a/src/include/catalog/pg_description.h +++ b/src/include/catalog/pg_description.h @@ -45,7 +45,7 @@ * typedef struct FormData_pg_description * ---------------- */ -CATALOG(pg_description,2609,DescriptionRelationId) BKI_WITHOUT_OIDS +CATALOG(pg_description,2609,DescriptionRelationId) { Oid objoid; /* OID of object itself */ Oid classoid; /* OID of table containing object */ diff --git a/src/include/catalog/pg_enum.h b/src/include/catalog/pg_enum.h index 474877749b2..78e289378cf 100644 --- a/src/include/catalog/pg_enum.h +++ b/src/include/catalog/pg_enum.h @@ -30,6 +30,7 @@ */ CATALOG(pg_enum,3501,EnumRelationId) { + Oid oid; /* oid */ Oid enumtypid; /* OID of owning enum type */ float4 enumsortorder; /* sort position of this enum value */ NameData enumlabel; /* text representation of enum value */ diff --git a/src/include/catalog/pg_event_trigger.h b/src/include/catalog/pg_event_trigger.h index 9af00fd68ff..16ee3098edd 100644 --- a/src/include/catalog/pg_event_trigger.h +++ b/src/include/catalog/pg_event_trigger.h @@ -28,6 +28,7 @@ */ CATALOG(pg_event_trigger,3466,EventTriggerRelationId) { + Oid oid; /* oid */ NameData evtname; /* trigger's name */ NameData evtevent; /* trigger's event */ Oid evtowner; /* trigger's owner */ diff --git a/src/include/catalog/pg_extension.h b/src/include/catalog/pg_extension.h index c698ddd699a..e3773f67251 100644 --- a/src/include/catalog/pg_extension.h +++ b/src/include/catalog/pg_extension.h @@ -28,6 +28,7 @@ */ CATALOG(pg_extension,3079,ExtensionRelationId) { + Oid oid; /* oid */ NameData extname; /* extension name */ Oid extowner; /* extension owner */ Oid extnamespace; /* namespace of contained objects */ diff --git a/src/include/catalog/pg_foreign_data_wrapper.h b/src/include/catalog/pg_foreign_data_wrapper.h index 3e6191e3e25..e70823c4393 100644 --- a/src/include/catalog/pg_foreign_data_wrapper.h +++ b/src/include/catalog/pg_foreign_data_wrapper.h @@ -28,6 +28,7 @@ */ CATALOG(pg_foreign_data_wrapper,2328,ForeignDataWrapperRelationId) { + Oid oid; /* oid */ NameData fdwname; /* foreign-data wrapper name */ Oid fdwowner; /* FDW owner */ Oid fdwhandler; /* handler function, or 0 if none */ diff --git a/src/include/catalog/pg_foreign_server.h b/src/include/catalog/pg_foreign_server.h index 3f7cc0c0469..49649bbd683 100644 --- a/src/include/catalog/pg_foreign_server.h +++ b/src/include/catalog/pg_foreign_server.h @@ -27,6 +27,7 @@ */ CATALOG(pg_foreign_server,1417,ForeignServerRelationId) { + Oid oid; /* oid */ NameData srvname; /* foreign server name */ Oid srvowner; /* server owner */ Oid srvfdw; /* server FDW */ diff --git a/src/include/catalog/pg_foreign_table.h b/src/include/catalog/pg_foreign_table.h index 6e8b4195201..d21dec3766e 100644 --- a/src/include/catalog/pg_foreign_table.h +++ b/src/include/catalog/pg_foreign_table.h @@ -25,7 +25,7 @@ * typedef struct FormData_pg_foreign_table * ---------------- */ -CATALOG(pg_foreign_table,3118,ForeignTableRelationId) BKI_WITHOUT_OIDS +CATALOG(pg_foreign_table,3118,ForeignTableRelationId) { Oid ftrelid; /* OID of foreign table */ Oid ftserver; /* OID of foreign server */ diff --git a/src/include/catalog/pg_index.h b/src/include/catalog/pg_index.h index 5f72a5571f2..ebe8955bf38 100644 --- a/src/include/catalog/pg_index.h +++ b/src/include/catalog/pg_index.h @@ -26,7 +26,7 @@ * typedef struct FormData_pg_index. * ---------------- */ -CATALOG(pg_index,2610,IndexRelationId) BKI_WITHOUT_OIDS BKI_SCHEMA_MACRO +CATALOG(pg_index,2610,IndexRelationId) BKI_SCHEMA_MACRO { Oid indexrelid; /* OID of the index */ Oid indrelid; /* OID of the relation it indexes */ diff --git a/src/include/catalog/pg_inherits.h b/src/include/catalog/pg_inherits.h index 2a98e02c6ac..07dfb63068b 100644 --- a/src/include/catalog/pg_inherits.h +++ b/src/include/catalog/pg_inherits.h @@ -29,7 +29,7 @@ * typedef struct FormData_pg_inherits * ---------------- */ -CATALOG(pg_inherits,2611,InheritsRelationId) BKI_WITHOUT_OIDS +CATALOG(pg_inherits,2611,InheritsRelationId) { Oid inhrelid; Oid inhparent; diff --git a/src/include/catalog/pg_init_privs.h b/src/include/catalog/pg_init_privs.h index 39de09cb9da..8a6da5ecf2d 100644 --- a/src/include/catalog/pg_init_privs.h +++ b/src/include/catalog/pg_init_privs.h @@ -43,7 +43,7 @@ * typedef struct FormData_pg_init_privs * ---------------- */ -CATALOG(pg_init_privs,3394,InitPrivsRelationId) BKI_WITHOUT_OIDS +CATALOG(pg_init_privs,3394,InitPrivsRelationId) { Oid objoid; /* OID of object itself */ Oid classoid; /* OID of table containing object */ diff --git a/src/include/catalog/pg_language.h b/src/include/catalog/pg_language.h index 359701b4522..03654d8d074 100644 --- a/src/include/catalog/pg_language.h +++ b/src/include/catalog/pg_language.h @@ -28,6 +28,8 @@ */ CATALOG(pg_language,2612,LanguageRelationId) { + Oid oid; /* oid */ + /* Language name */ NameData lanname; diff --git a/src/include/catalog/pg_largeobject.h b/src/include/catalog/pg_largeobject.h index a8aa42e049a..1497c97cee5 100644 --- a/src/include/catalog/pg_largeobject.h +++ b/src/include/catalog/pg_largeobject.h @@ -26,7 +26,7 @@ * typedef struct FormData_pg_largeobject * ---------------- */ -CATALOG(pg_largeobject,2613,LargeObjectRelationId) BKI_WITHOUT_OIDS +CATALOG(pg_largeobject,2613,LargeObjectRelationId) { Oid loid; /* Identifier of large object */ int32 pageno; /* Page number (starting from 0) */ diff --git a/src/include/catalog/pg_largeobject_metadata.h b/src/include/catalog/pg_largeobject_metadata.h index c8560dc2afb..ef6427b8cc3 100644 --- a/src/include/catalog/pg_largeobject_metadata.h +++ b/src/include/catalog/pg_largeobject_metadata.h @@ -29,6 +29,8 @@ */ CATALOG(pg_largeobject_metadata,2995,LargeObjectMetadataRelationId) { + Oid oid; /* oid */ + Oid lomowner; /* OID of the largeobject owner */ #ifdef CATALOG_VARLEN /* variable-length fields start here */ diff --git a/src/include/catalog/pg_namespace.h b/src/include/catalog/pg_namespace.h index 0923e066b46..a7e101202f0 100644 --- a/src/include/catalog/pg_namespace.h +++ b/src/include/catalog/pg_namespace.h @@ -33,6 +33,8 @@ */ CATALOG(pg_namespace,2615,NamespaceRelationId) { + Oid oid; /* oid */ + NameData nspname; Oid nspowner; diff --git a/src/include/catalog/pg_opclass.h b/src/include/catalog/pg_opclass.h index b980327fc03..5d229505077 100644 --- a/src/include/catalog/pg_opclass.h +++ b/src/include/catalog/pg_opclass.h @@ -48,6 +48,8 @@ */ CATALOG(pg_opclass,2616,OperatorClassRelationId) { + Oid oid; /* oid */ + /* index access method opclass is for */ Oid opcmethod BKI_LOOKUP(pg_am); diff --git a/src/include/catalog/pg_operator.h b/src/include/catalog/pg_operator.h index 3212b21418b..ca3ae6e191f 100644 --- a/src/include/catalog/pg_operator.h +++ b/src/include/catalog/pg_operator.h @@ -31,6 +31,8 @@ */ CATALOG(pg_operator,2617,OperatorRelationId) { + Oid oid; /* oid */ + /* name of operator */ NameData oprname; diff --git a/src/include/catalog/pg_opfamily.h b/src/include/catalog/pg_opfamily.h index 99dedbc42d1..ce37ede57bf 100644 --- a/src/include/catalog/pg_opfamily.h +++ b/src/include/catalog/pg_opfamily.h @@ -28,6 +28,8 @@ */ CATALOG(pg_opfamily,2753,OperatorFamilyRelationId) { + Oid oid; /* oid */ + /* index access method opfamily is for */ Oid opfmethod BKI_LOOKUP(pg_am); diff --git a/src/include/catalog/pg_partitioned_table.h b/src/include/catalog/pg_partitioned_table.h index 78bc5c81fbc..39095fa69b1 100644 --- a/src/include/catalog/pg_partitioned_table.h +++ b/src/include/catalog/pg_partitioned_table.h @@ -27,7 +27,7 @@ * typedef struct FormData_pg_partitioned_table * ---------------- */ -CATALOG(pg_partitioned_table,3350,PartitionedRelationId) BKI_WITHOUT_OIDS +CATALOG(pg_partitioned_table,3350,PartitionedRelationId) { Oid partrelid; /* partitioned table oid */ char partstrat; /* partitioning strategy */ diff --git a/src/include/catalog/pg_pltemplate.h b/src/include/catalog/pg_pltemplate.h index ae06b752125..fba9efac90e 100644 --- a/src/include/catalog/pg_pltemplate.h +++ b/src/include/catalog/pg_pltemplate.h @@ -26,7 +26,7 @@ * typedef struct FormData_pg_pltemplate * ---------------- */ -CATALOG(pg_pltemplate,1136,PLTemplateRelationId) BKI_SHARED_RELATION BKI_WITHOUT_OIDS +CATALOG(pg_pltemplate,1136,PLTemplateRelationId) BKI_SHARED_RELATION { NameData tmplname; /* name of PL */ bool tmpltrusted; /* PL is trusted? */ diff --git a/src/include/catalog/pg_policy.h b/src/include/catalog/pg_policy.h index 0dd9c50e536..d7eb1bd7596 100644 --- a/src/include/catalog/pg_policy.h +++ b/src/include/catalog/pg_policy.h @@ -28,6 +28,7 @@ */ CATALOG(pg_policy,3256,PolicyRelationId) { + Oid oid; /* oid */ NameData polname; /* Policy name. */ Oid polrelid; /* Oid of the relation with policy. */ char polcmd; /* One of ACL_*_CHR, or '*' for all */ diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index 9264a2e9872..034a41eb556 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -3122,6 +3122,11 @@ prorettype => 'int8', proargtypes => 'regclass', prosrc => 'pg_sequence_last_value' }, +{ oid => '275', descr => 'return the next oid for a system table', + proname => 'pg_nextoid', provolatile => 'v', proparallel => 'u', + prorettype => 'oid', proargtypes => 'regclass name regclass', + prosrc => 'pg_nextoid' }, + { oid => '1579', descr => 'I/O', proname => 'varbit_in', prorettype => 'varbit', proargtypes => 'cstring oid int4', prosrc => 'varbit_in' }, diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index a34b2596fa0..b25dec6c311 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -30,6 +30,8 @@ */ CATALOG(pg_proc,1255,ProcedureRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(81,ProcedureRelation_Rowtype_Id) BKI_SCHEMA_MACRO { + Oid oid; /* oid */ + /* procedure name */ NameData proname; diff --git a/src/include/catalog/pg_publication.h b/src/include/catalog/pg_publication.h index a5d5570f76e..062b5afa0b5 100644 --- a/src/include/catalog/pg_publication.h +++ b/src/include/catalog/pg_publication.h @@ -29,6 +29,8 @@ */ CATALOG(pg_publication,6104,PublicationRelationId) { + Oid oid; /* oid */ + NameData pubname; /* name of the publication */ Oid pubowner; /* publication owner */ diff --git a/src/include/catalog/pg_publication_rel.h b/src/include/catalog/pg_publication_rel.h index d97b0fe9bd3..5a6a802653d 100644 --- a/src/include/catalog/pg_publication_rel.h +++ b/src/include/catalog/pg_publication_rel.h @@ -28,6 +28,7 @@ */ CATALOG(pg_publication_rel,6106,PublicationRelRelationId) { + Oid oid; /* oid */ Oid prpubid; /* Oid of the publication */ Oid prrelid; /* Oid of the relation */ } FormData_pg_publication_rel; diff --git a/src/include/catalog/pg_range.h b/src/include/catalog/pg_range.h index ca2b28b4936..32a7b2d1ae3 100644 --- a/src/include/catalog/pg_range.h +++ b/src/include/catalog/pg_range.h @@ -26,7 +26,7 @@ * typedef struct FormData_pg_range * ---------------- */ -CATALOG(pg_range,3541,RangeRelationId) BKI_WITHOUT_OIDS +CATALOG(pg_range,3541,RangeRelationId) { /* OID of owning range type */ Oid rngtypid BKI_LOOKUP(pg_type); diff --git a/src/include/catalog/pg_replication_origin.h b/src/include/catalog/pg_replication_origin.h index 82ff7a7c692..dd5a2e29648 100644 --- a/src/include/catalog/pg_replication_origin.h +++ b/src/include/catalog/pg_replication_origin.h @@ -28,7 +28,7 @@ * typedef struct FormData_pg_replication_origin * ---------------- */ -CATALOG(pg_replication_origin,6000,ReplicationOriginRelationId) BKI_SHARED_RELATION BKI_WITHOUT_OIDS +CATALOG(pg_replication_origin,6000,ReplicationOriginRelationId) BKI_SHARED_RELATION { /* * Locally known id that get included into WAL. diff --git a/src/include/catalog/pg_rewrite.h b/src/include/catalog/pg_rewrite.h index 0e50b879265..9b2b06dfa4d 100644 --- a/src/include/catalog/pg_rewrite.h +++ b/src/include/catalog/pg_rewrite.h @@ -31,6 +31,7 @@ */ CATALOG(pg_rewrite,2618,RewriteRelationId) { + Oid oid; /* oid */ NameData rulename; Oid ev_class; char ev_type; diff --git a/src/include/catalog/pg_seclabel.h b/src/include/catalog/pg_seclabel.h index 6889369b5de..6bef8353b64 100644 --- a/src/include/catalog/pg_seclabel.h +++ b/src/include/catalog/pg_seclabel.h @@ -25,7 +25,7 @@ * typedef struct FormData_pg_seclabel * ---------------- */ -CATALOG(pg_seclabel,3596,SecLabelRelationId) BKI_WITHOUT_OIDS +CATALOG(pg_seclabel,3596,SecLabelRelationId) { Oid objoid; /* OID of the object itself */ Oid classoid; /* OID of table containing the object */ diff --git a/src/include/catalog/pg_sequence.h b/src/include/catalog/pg_sequence.h index beea215c81e..abd1a9d0437 100644 --- a/src/include/catalog/pg_sequence.h +++ b/src/include/catalog/pg_sequence.h @@ -20,7 +20,7 @@ #include "catalog/genbki.h" #include "catalog/pg_sequence_d.h" -CATALOG(pg_sequence,2224,SequenceRelationId) BKI_WITHOUT_OIDS +CATALOG(pg_sequence,2224,SequenceRelationId) { Oid seqrelid; Oid seqtypid; diff --git a/src/include/catalog/pg_shdepend.h b/src/include/catalog/pg_shdepend.h index 01e1eb760c7..3d560f4295f 100644 --- a/src/include/catalog/pg_shdepend.h +++ b/src/include/catalog/pg_shdepend.h @@ -34,7 +34,7 @@ * typedef struct FormData_pg_shdepend * ---------------- */ -CATALOG(pg_shdepend,1214,SharedDependRelationId) BKI_SHARED_RELATION BKI_WITHOUT_OIDS +CATALOG(pg_shdepend,1214,SharedDependRelationId) BKI_SHARED_RELATION { /* * Identification of the dependent (referencing) object. diff --git a/src/include/catalog/pg_shdescription.h b/src/include/catalog/pg_shdescription.h index 53cade15488..47a6729f003 100644 --- a/src/include/catalog/pg_shdescription.h +++ b/src/include/catalog/pg_shdescription.h @@ -38,7 +38,7 @@ * typedef struct FormData_pg_shdescription * ---------------- */ -CATALOG(pg_shdescription,2396,SharedDescriptionRelationId) BKI_SHARED_RELATION BKI_WITHOUT_OIDS +CATALOG(pg_shdescription,2396,SharedDescriptionRelationId) BKI_SHARED_RELATION { Oid objoid; /* OID of object itself */ Oid classoid; /* OID of table containing object */ diff --git a/src/include/catalog/pg_shseclabel.h b/src/include/catalog/pg_shseclabel.h index 2630f965fd3..2a66ca36025 100644 --- a/src/include/catalog/pg_shseclabel.h +++ b/src/include/catalog/pg_shseclabel.h @@ -25,7 +25,7 @@ * typedef struct FormData_pg_shseclabel * ---------------- */ -CATALOG(pg_shseclabel,3592,SharedSecLabelRelationId) BKI_SHARED_RELATION BKI_ROWTYPE_OID(4066,SharedSecLabelRelation_Rowtype_Id) BKI_WITHOUT_OIDS BKI_SCHEMA_MACRO +CATALOG(pg_shseclabel,3592,SharedSecLabelRelationId) BKI_SHARED_RELATION BKI_ROWTYPE_OID(4066,SharedSecLabelRelation_Rowtype_Id) BKI_SCHEMA_MACRO { Oid objoid; /* OID of the shared object itself */ Oid classoid; /* OID of table containing the shared object */ diff --git a/src/include/catalog/pg_statistic.h b/src/include/catalog/pg_statistic.h index 141e260de94..49223aab4fc 100644 --- a/src/include/catalog/pg_statistic.h +++ b/src/include/catalog/pg_statistic.h @@ -26,7 +26,7 @@ * typedef struct FormData_pg_statistic * ---------------- */ -CATALOG(pg_statistic,2619,StatisticRelationId) BKI_WITHOUT_OIDS +CATALOG(pg_statistic,2619,StatisticRelationId) { /* These fields form the unique key for the entry: */ Oid starelid; /* relation containing attribute */ diff --git a/src/include/catalog/pg_statistic_ext.h b/src/include/catalog/pg_statistic_ext.h index 443798ae523..e2e8d4f6d4f 100644 --- a/src/include/catalog/pg_statistic_ext.h +++ b/src/include/catalog/pg_statistic_ext.h @@ -28,6 +28,8 @@ */ CATALOG(pg_statistic_ext,3381,StatisticExtRelationId) { + Oid oid; /* oid */ + Oid stxrelid; /* relation containing attributes */ /* These two fields form the unique key for the entry: */ diff --git a/src/include/catalog/pg_subscription.h b/src/include/catalog/pg_subscription.h index e4dc771cf53..4298c3cbf29 100644 --- a/src/include/catalog/pg_subscription.h +++ b/src/include/catalog/pg_subscription.h @@ -38,6 +38,8 @@ */ CATALOG(pg_subscription,6100,SubscriptionRelationId) BKI_SHARED_RELATION BKI_ROWTYPE_OID(6101,SubscriptionRelation_Rowtype_Id) BKI_SCHEMA_MACRO { + Oid oid; /* oid */ + Oid subdbid; /* Database the subscription is in. */ NameData subname; /* Name of the subscription */ diff --git a/src/include/catalog/pg_subscription_rel.h b/src/include/catalog/pg_subscription_rel.h index 556cb94841d..efd7901032e 100644 --- a/src/include/catalog/pg_subscription_rel.h +++ b/src/include/catalog/pg_subscription_rel.h @@ -29,7 +29,7 @@ * typedef struct FormData_pg_subscription_rel * ---------------- */ -CATALOG(pg_subscription_rel,6102,SubscriptionRelRelationId) BKI_WITHOUT_OIDS +CATALOG(pg_subscription_rel,6102,SubscriptionRelRelationId) { Oid srsubid; /* Oid of subscription */ Oid srrelid; /* Oid of relation */ @@ -67,9 +67,9 @@ typedef struct SubscriptionRelState char state; } SubscriptionRelState; -extern Oid AddSubscriptionRelState(Oid subid, Oid relid, char state, +extern void AddSubscriptionRelState(Oid subid, Oid relid, char state, XLogRecPtr sublsn); -extern Oid UpdateSubscriptionRelState(Oid subid, Oid relid, char state, +extern void UpdateSubscriptionRelState(Oid subid, Oid relid, char state, XLogRecPtr sublsn); extern char GetSubscriptionRelState(Oid subid, Oid relid, XLogRecPtr *sublsn, bool missing_ok); diff --git a/src/include/catalog/pg_tablespace.h b/src/include/catalog/pg_tablespace.h index 4010f1b5a73..80caefd77aa 100644 --- a/src/include/catalog/pg_tablespace.h +++ b/src/include/catalog/pg_tablespace.h @@ -28,6 +28,7 @@ */ CATALOG(pg_tablespace,1213,TableSpaceRelationId) BKI_SHARED_RELATION { + Oid oid; /* oid */ NameData spcname; /* tablespace name */ Oid spcowner; /* owner of tablespace */ diff --git a/src/include/catalog/pg_transform.h b/src/include/catalog/pg_transform.h index f46ff0a90e0..e92f0bccd1c 100644 --- a/src/include/catalog/pg_transform.h +++ b/src/include/catalog/pg_transform.h @@ -28,6 +28,7 @@ */ CATALOG(pg_transform,3576,TransformRelationId) { + Oid oid; /* oid */ Oid trftype; Oid trflang; regproc trffromsql; diff --git a/src/include/catalog/pg_trigger.h b/src/include/catalog/pg_trigger.h index 951d7d86e75..c3a685304b0 100644 --- a/src/include/catalog/pg_trigger.h +++ b/src/include/catalog/pg_trigger.h @@ -33,6 +33,7 @@ */ CATALOG(pg_trigger,2620,TriggerRelationId) { + Oid oid; /* oid */ Oid tgrelid; /* relation trigger is attached to */ NameData tgname; /* trigger's name */ Oid tgfoid; /* OID of function to be called */ diff --git a/src/include/catalog/pg_ts_config.h b/src/include/catalog/pg_ts_config.h index ce93c2b7ffb..d15db9b4b91 100644 --- a/src/include/catalog/pg_ts_config.h +++ b/src/include/catalog/pg_ts_config.h @@ -29,6 +29,7 @@ */ CATALOG(pg_ts_config,3602,TSConfigRelationId) { + Oid oid; /* oid */ NameData cfgname; /* name of configuration */ Oid cfgnamespace; /* name space */ Oid cfgowner; /* owner */ diff --git a/src/include/catalog/pg_ts_config_map.h b/src/include/catalog/pg_ts_config_map.h index 58563233733..37d81e5597e 100644 --- a/src/include/catalog/pg_ts_config_map.h +++ b/src/include/catalog/pg_ts_config_map.h @@ -27,7 +27,7 @@ * typedef struct FormData_pg_ts_config_map * ---------------- */ -CATALOG(pg_ts_config_map,3603,TSConfigMapRelationId) BKI_WITHOUT_OIDS +CATALOG(pg_ts_config_map,3603,TSConfigMapRelationId) { Oid mapcfg; /* OID of configuration owning this entry */ int32 maptokentype; /* token type from parser */ diff --git a/src/include/catalog/pg_ts_dict.h b/src/include/catalog/pg_ts_dict.h index cd5f150fe8e..5c4182abac1 100644 --- a/src/include/catalog/pg_ts_dict.h +++ b/src/include/catalog/pg_ts_dict.h @@ -28,6 +28,7 @@ */ CATALOG(pg_ts_dict,3600,TSDictionaryRelationId) { + Oid oid; /* oid */ NameData dictname; /* dictionary name */ Oid dictnamespace; /* name space */ Oid dictowner; /* owner */ diff --git a/src/include/catalog/pg_ts_parser.h b/src/include/catalog/pg_ts_parser.h index 34585eac00c..b46a91525e3 100644 --- a/src/include/catalog/pg_ts_parser.h +++ b/src/include/catalog/pg_ts_parser.h @@ -28,6 +28,8 @@ */ CATALOG(pg_ts_parser,3601,TSParserRelationId) { + Oid oid; /* oid */ + /* parser's name */ NameData prsname; diff --git a/src/include/catalog/pg_ts_template.h b/src/include/catalog/pg_ts_template.h index 50be08eca56..d970ebf659d 100644 --- a/src/include/catalog/pg_ts_template.h +++ b/src/include/catalog/pg_ts_template.h @@ -28,6 +28,8 @@ */ CATALOG(pg_ts_template,3764,TSTemplateRelationId) { + Oid oid; /* oid */ + /* template name */ NameData tmplname; diff --git a/src/include/catalog/pg_type.h b/src/include/catalog/pg_type.h index 87c9b673cf4..05185dd809d 100644 --- a/src/include/catalog/pg_type.h +++ b/src/include/catalog/pg_type.h @@ -36,6 +36,8 @@ */ CATALOG(pg_type,1247,TypeRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(71,TypeRelation_Rowtype_Id) BKI_SCHEMA_MACRO { + Oid oid; /* oid */ + /* type name */ NameData typname; diff --git a/src/include/catalog/pg_user_mapping.h b/src/include/catalog/pg_user_mapping.h index e4e2ff36dcf..985ad9b94cd 100644 --- a/src/include/catalog/pg_user_mapping.h +++ b/src/include/catalog/pg_user_mapping.h @@ -27,6 +27,8 @@ */ CATALOG(pg_user_mapping,1418,UserMappingRelationId) { + Oid oid; /* oid */ + Oid umuser; /* Id of the user, InvalidOid if PUBLIC is * wanted */ Oid umserver; /* server of this mapping */ diff --git a/src/include/catalog/reformat_dat_file.pl b/src/include/catalog/reformat_dat_file.pl index ca20fb86da1..41c57c5d632 100755 --- a/src/include/catalog/reformat_dat_file.pl +++ b/src/include/catalog/reformat_dat_file.pl @@ -26,8 +26,11 @@ use FindBin; use lib "$FindBin::RealBin/../../backend/catalog/"; use Catalog; -# Names of the metadata fields of a catalog entry. (line_number is also -# a metadata field, but we never write it out, so it's not listed here.) +# Names of the metadata fields of a catalog entry. +# Note: oid is a normal column from a storage perspective, but it's more +# important than the rest, so it's listed first among the metadata fields. +# Note: line_number is also a metadata field, but we never write it out, +# so it's not listed here. my @METADATA = ('oid', 'oid_symbol', 'array_type_oid', 'descr', 'autogenerated'); @@ -119,7 +122,12 @@ foreach my $catname (@catnames) foreach my $column (@$schema) { my $attname = $column->{name}; - push @attnames, $attname; + + # We may have ordinary columns at the storage level that we still + # want to format as a special value. Exclude these from the column + # list so they are not written twice. + push @attnames, $attname + if !(grep { $_ eq $attname } @METADATA); } # Overwrite .dat files in place, since they are under version control. @@ -192,8 +200,11 @@ sub strip_default_values foreach my $column (@$schema) { my $attname = $column->{name}; + + # It's okay if we have no oid value, since it will be assigned + # automatically before bootstrap. die "strip_default_values: $catname.$attname undefined\n" - if !defined $row->{$attname}; + if !defined $row->{$attname} and $attname ne 'oid'; if (defined $column->{default} and ($row->{$attname} eq $column->{default})) diff --git a/src/include/commands/copy.h b/src/include/commands/copy.h index f393e7e73d7..b5cadce3efa 100644 --- a/src/include/commands/copy.h +++ b/src/include/commands/copy.h @@ -32,7 +32,7 @@ extern CopyState BeginCopyFrom(ParseState *pstate, Relation rel, const char *fil bool is_program, copy_data_source_cb data_source_cb, List *attnamelist, List *options); extern void EndCopyFrom(CopyState cstate); extern bool NextCopyFrom(CopyState cstate, ExprContext *econtext, - Datum *values, bool *nulls, Oid *tupleOid); + Datum *values, bool *nulls); extern bool NextCopyFromRawFields(CopyState cstate, char ***fields, int *nfields); extern void CopyFromErrorCallback(void *arg); diff --git a/src/include/commands/event_trigger.h b/src/include/commands/event_trigger.h index 0e1959462eb..5a2fc6c8d71 100644 --- a/src/include/commands/event_trigger.h +++ b/src/include/commands/event_trigger.h @@ -31,7 +31,6 @@ typedef struct EventTriggerData #define AT_REWRITE_ALTER_PERSISTENCE 0x01 #define AT_REWRITE_DEFAULT_VAL 0x02 #define AT_REWRITE_COLUMN_REWRITE 0x04 -#define AT_REWRITE_ALTER_OID 0x08 /* * EventTriggerData is the node type that is passed as fmgr "context" info diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h index 14c4e3ae2fa..2feec628c03 100644 --- a/src/include/executor/executor.h +++ b/src/include/executor/executor.h @@ -50,19 +50,13 @@ * AfterTriggerBeginQuery/AfterTriggerEndQuery. This does not necessarily * mean that the plan can't queue any AFTER triggers; just that the caller * is responsible for there being a trigger context for them to be queued in. - * - * WITH/WITHOUT_OIDS tell the executor to emit tuples with or without space - * for OIDs, respectively. These are currently used only for CREATE TABLE AS. - * If neither is set, the plan may or may not produce tuples including OIDs. */ #define EXEC_FLAG_EXPLAIN_ONLY 0x0001 /* EXPLAIN, no ANALYZE */ #define EXEC_FLAG_REWIND 0x0002 /* need efficient rescan */ #define EXEC_FLAG_BACKWARD 0x0004 /* need backward scan */ #define EXEC_FLAG_MARK 0x0008 /* need mark/restore */ #define EXEC_FLAG_SKIP_TRIGGERS 0x0010 /* skip AfterTrigger calls */ -#define EXEC_FLAG_WITH_OIDS 0x0020 /* force OIDs in returned tuples */ -#define EXEC_FLAG_WITHOUT_OIDS 0x0040 /* force no OIDs in returned tuples */ -#define EXEC_FLAG_WITH_NO_DATA 0x0080 /* rel scannability doesn't matter */ +#define EXEC_FLAG_WITH_NO_DATA 0x0020 /* rel scannability doesn't matter */ /* Hook for plugins to get control in ExecutorStart() */ @@ -140,7 +134,7 @@ extern TupleHashEntry FindTupleHashEntry(TupleHashTable hashtable, /* * prototypes from functions in execJunk.c */ -extern JunkFilter *ExecInitJunkFilter(List *targetList, bool hasoid, +extern JunkFilter *ExecInitJunkFilter(List *targetList, TupleTableSlot *slot); extern JunkFilter *ExecInitJunkFilterConversion(List *targetList, TupleDesc cleanTupType, @@ -178,7 +172,6 @@ extern void InitResultRelInfo(ResultRelInfo *resultRelInfo, int instrument_options); extern ResultRelInfo *ExecGetTriggerResultRel(EState *estate, Oid relid); extern void ExecCleanUpTriggerState(EState *estate); -extern bool ExecContextForcesOids(PlanState *planstate, bool *hasoids); extern void ExecConstraints(ResultRelInfo *resultRelInfo, TupleTableSlot *slot, EState *estate); extern bool ExecPartitionCheck(ResultRelInfo *resultRelInfo, @@ -443,8 +436,8 @@ extern TupleTableSlot *ExecInitExtraTupleSlot(EState *estate, const TupleTableSlotOps *tts_ops); extern TupleTableSlot *ExecInitNullTupleSlot(EState *estate, TupleDesc tupType, const TupleTableSlotOps *tts_ops); -extern TupleDesc ExecTypeFromTL(List *targetList, bool hasoid); -extern TupleDesc ExecCleanTypeFromTL(List *targetList, bool hasoid); +extern TupleDesc ExecTypeFromTL(List *targetList); +extern TupleDesc ExecCleanTypeFromTL(List *targetList); extern TupleDesc ExecTypeFromExprList(List *exprList); extern void ExecTypeSetColNames(TupleDesc typeInfo, List *namesList); extern void UpdateChangedParamSet(PlanState *node, Bitmapset *newchg); diff --git a/src/include/executor/spi.h b/src/include/executor/spi.h index b16440cf004..d2616968ac4 100644 --- a/src/include/executor/spi.h +++ b/src/include/executor/spi.h @@ -75,7 +75,6 @@ typedef struct _SPI_plan *SPIPlanPtr; #define SPI_restore_connection() ((void) 0) extern PGDLLIMPORT uint64 SPI_processed; -extern PGDLLIMPORT Oid SPI_lastoid; extern PGDLLIMPORT SPITupleTable *SPI_tuptable; extern PGDLLIMPORT int SPI_result; diff --git a/src/include/executor/spi_priv.h b/src/include/executor/spi_priv.h index 0da3a41050e..d86d7e0a831 100644 --- a/src/include/executor/spi_priv.h +++ b/src/include/executor/spi_priv.h @@ -23,7 +23,6 @@ typedef struct { /* current results */ uint64 processed; /* by Executor */ - Oid lastoid; SPITupleTable *tuptable; /* tuptable currently being built */ /* subtransaction in which current Executor call was started */ @@ -45,7 +44,6 @@ typedef struct /* saved values of API global variables for previous nesting level */ uint64 outer_processed; - Oid outer_lastoid; SPITupleTable *outer_tuptable; int outer_result; } _SPI_connection; diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 569cc7c4761..5ed0f40f697 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -541,7 +541,6 @@ typedef struct EState List *es_tupleTable; /* List of TupleTableSlots */ uint64 es_processed; /* # of tuples processed */ - Oid es_lastoid; /* last oid processed (by INSERT) */ int es_top_eflags; /* eflags passed to ExecutorStart */ int es_instrument; /* OR of InstrumentOption flags */ diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 9da8bf2f887..e5bdc1cec57 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -1769,8 +1769,6 @@ typedef enum AlterTableType AT_DropCluster, /* SET WITHOUT CLUSTER */ AT_SetLogged, /* SET LOGGED */ AT_SetUnLogged, /* SET UNLOGGED */ - AT_AddOids, /* SET WITH OIDS */ - AT_AddOidsRecurse, /* internal to commands/tablecmds.c */ AT_DropOids, /* SET WITHOUT OIDS */ AT_SetTableSpace, /* SET TABLESPACE */ AT_SetRelOptions, /* SET (...) -- AM specific parameters */ diff --git a/src/include/parser/parse_clause.h b/src/include/parser/parse_clause.h index 2c0e0928628..f37f55302fb 100644 --- a/src/include/parser/parse_clause.h +++ b/src/include/parser/parse_clause.h @@ -19,7 +19,6 @@ extern void transformFromClause(ParseState *pstate, List *frmList); extern int setTargetTable(ParseState *pstate, RangeVar *relation, bool inh, bool alsoSource, AclMode requiredPerms); -extern bool interpretOidsOption(List *defList, bool allowOids); extern Node *transformWhereClause(ParseState *pstate, Node *clause, ParseExprKind exprKind, const char *constructName); diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index f462eabe594..df2e556b021 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -244,7 +244,6 @@ extern bool log_statement_stats; extern bool log_btree_build_stats; extern PGDLLIMPORT bool check_function_bodies; -extern bool default_with_oids; extern bool session_auth_is_superuser; extern int log_min_error_statement; diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index 84469f57151..2217081dcc3 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -103,7 +103,6 @@ typedef struct RelationData /* data managed by RelationGetIndexList: */ List *rd_indexlist; /* list of OIDs of indexes on relation */ - Oid rd_oidindex; /* OID of unique index on OID, if any */ Oid rd_pkindex; /* OID of primary key, if any */ Oid rd_replidindex; /* OID of replica identity index, if any */ diff --git a/src/include/utils/relcache.h b/src/include/utils/relcache.h index dbbf41b0c16..a99d6b6681d 100644 --- a/src/include/utils/relcache.h +++ b/src/include/utils/relcache.h @@ -45,7 +45,6 @@ extern void RelationClose(Relation relation); extern List *RelationGetFKeyList(Relation relation); extern List *RelationGetIndexList(Relation relation); extern List *RelationGetStatExtList(Relation relation); -extern Oid RelationGetOidIndex(Relation relation); extern Oid RelationGetPrimaryKeyIndex(Relation relation); extern Oid RelationGetReplicaIndex(Relation relation); extern List *RelationGetIndexExpressions(Relation relation); @@ -69,7 +68,7 @@ extern void RelationGetExclusionInfo(Relation indexRelation, uint16 **strategies); extern void RelationSetIndexList(Relation relation, - List *indexIds, Oid oidIndex); + List *indexIds); extern void RelationInitIndexAccessInfo(Relation relation); diff --git a/src/include/utils/syscache.h b/src/include/utils/syscache.h index 4f333586ee9..6f290c7214d 100644 --- a/src/include/utils/syscache.h +++ b/src/include/utils/syscache.h @@ -138,7 +138,7 @@ extern HeapTuple SearchSysCacheCopy(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4); extern bool SearchSysCacheExists(int cacheId, Datum key1, Datum key2, Datum key3, Datum key4); -extern Oid GetSysCacheOid(int cacheId, +extern Oid GetSysCacheOid(int cacheId, AttrNumber oidcol, Datum key1, Datum key2, Datum key3, Datum key4); extern HeapTuple SearchSysCacheAttName(Oid relid, const char *attname); @@ -188,14 +188,14 @@ extern bool RelationSupportsSysCache(Oid relid); #define SearchSysCacheExists4(cacheId, key1, key2, key3, key4) \ SearchSysCacheExists(cacheId, key1, key2, key3, key4) -#define GetSysCacheOid1(cacheId, key1) \ - GetSysCacheOid(cacheId, key1, 0, 0, 0) -#define GetSysCacheOid2(cacheId, key1, key2) \ - GetSysCacheOid(cacheId, key1, key2, 0, 0) -#define GetSysCacheOid3(cacheId, key1, key2, key3) \ - GetSysCacheOid(cacheId, key1, key2, key3, 0) -#define GetSysCacheOid4(cacheId, key1, key2, key3, key4) \ - GetSysCacheOid(cacheId, key1, key2, key3, key4) +#define GetSysCacheOid1(cacheId, oidcol, key1) \ + GetSysCacheOid(cacheId, oidcol, key1, 0, 0, 0) +#define GetSysCacheOid2(cacheId, oidcol, key1, key2) \ + GetSysCacheOid(cacheId, oidcol, key1, key2, 0, 0) +#define GetSysCacheOid3(cacheId, oidcol, key1, key2, key3) \ + GetSysCacheOid(cacheId, oidcol, key1, key2, key3, 0) +#define GetSysCacheOid4(cacheId, oidcol, key1, key2, key3, key4) \ + GetSysCacheOid(cacheId, oidcol, key1, key2, key3, key4) #define GetSysCacheHashValue1(cacheId, key1) \ GetSysCacheHashValue(cacheId, key1, 0, 0, 0) |