Skip to content

Commit d2c86a1

Browse files
committed
Remove RELKIND_UNCATALOGED.
This may have been important at some point in the past, but it no longer does anything useful. Review by Tom Lane.
1 parent 7582e0b commit d2c86a1

File tree

10 files changed

+9
-19
lines changed

10 files changed

+9
-19
lines changed

contrib/pgstattuple/pgstattuple.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,6 @@ pgstat_relation(Relation rel, FunctionCallInfo fcinfo)
217217
{
218218
case RELKIND_RELATION:
219219
case RELKIND_TOASTVALUE:
220-
case RELKIND_UNCATALOGED:
221220
case RELKIND_SEQUENCE:
222221
return pgstat_heap(rel, fcinfo);
223222
case RELKIND_INDEX:

src/backend/access/common/reloptions.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,6 @@ extractRelOptions(HeapTuple tuple, TupleDesc tupdesc, Oid amoptions)
790790
case RELKIND_RELATION:
791791
case RELKIND_TOASTVALUE:
792792
case RELKIND_VIEW:
793-
case RELKIND_UNCATALOGED:
794793
options = heap_reloptions(classForm->relkind, datum, false);
795794
break;
796795
case RELKIND_INDEX:

src/backend/catalog/dependency.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2968,10 +2968,6 @@ getRelationDescription(StringInfo buffer, Oid relid)
29682968
appendStringInfo(buffer, _("sequence %s"),
29692969
relname);
29702970
break;
2971-
case RELKIND_UNCATALOGED:
2972-
appendStringInfo(buffer, _("uncataloged table %s"),
2973-
relname);
2974-
break;
29752971
case RELKIND_TOASTVALUE:
29762972
appendStringInfo(buffer, _("toast table %s"),
29772973
relname);

src/backend/catalog/heap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ heap_create(const char *relname,
327327
reltablespace,
328328
shared_relation,
329329
mapped_relation,
330-
relpersistence);
330+
relpersistence,
331+
relkind);
331332

332333
/*
333334
* Have the storage manager create the relation's disk file, if needed.
@@ -889,7 +890,6 @@ AddNewRelationTuple(Relation pg_class_desc,
889890
new_rel_reltup->relowner = relowner;
890891
new_rel_reltup->reltype = new_type_oid;
891892
new_rel_reltup->reloftype = reloftype;
892-
new_rel_reltup->relkind = relkind;
893893

894894
new_rel_desc->rd_att->tdtypeid = new_type_oid;
895895

src/backend/catalog/index.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,6 @@ index_create(Relation heapRelation,
836836
*/
837837
indexRelation->rd_rel->relowner = heapRelation->rd_rel->relowner;
838838
indexRelation->rd_rel->relam = accessMethodObjectId;
839-
indexRelation->rd_rel->relkind = RELKIND_INDEX;
840839
indexRelation->rd_rel->relhasoids = false;
841840

842841
/*

src/backend/catalog/toasting.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ BootstrapToastTable(char *relName, Oid toastOid, Oid toastIndexOid)
8484

8585
rel = heap_openrv(makeRangeVar(NULL, relName, -1), AccessExclusiveLock);
8686

87-
/* Note: during bootstrap may see uncataloged relation */
88-
if (rel->rd_rel->relkind != RELKIND_RELATION &&
89-
rel->rd_rel->relkind != RELKIND_UNCATALOGED)
87+
if (rel->rd_rel->relkind != RELKIND_RELATION)
9088
ereport(ERROR,
9189
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
9290
errmsg("\"%s\" is not a table",

src/backend/commands/indexcmds.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,7 @@ DefineIndex(RangeVar *heapRelation,
378378
relationId = RelationGetRelid(rel);
379379
namespaceId = RelationGetNamespace(rel);
380380

381-
/* Note: during bootstrap may see uncataloged relation */
382-
if (rel->rd_rel->relkind != RELKIND_RELATION &&
383-
rel->rd_rel->relkind != RELKIND_UNCATALOGED)
381+
if (rel->rd_rel->relkind != RELKIND_RELATION)
384382
{
385383
if (rel->rd_rel->relkind == RELKIND_FOREIGN_TABLE)
386384

src/backend/utils/cache/relcache.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2409,7 +2409,8 @@ RelationBuildLocalRelation(const char *relname,
24092409
Oid reltablespace,
24102410
bool shared_relation,
24112411
bool mapped_relation,
2412-
char relpersistence)
2412+
char relpersistence,
2413+
char relkind)
24132414
{
24142415
Relation rel;
24152416
MemoryContext oldcxt;
@@ -2515,7 +2516,7 @@ RelationBuildLocalRelation(const char *relname,
25152516
namestrcpy(&rel->rd_rel->relname, relname);
25162517
rel->rd_rel->relnamespace = relnamespace;
25172518

2518-
rel->rd_rel->relkind = RELKIND_UNCATALOGED;
2519+
rel->rd_rel->relkind = relkind;
25192520
rel->rd_rel->relhasoids = rel->rd_att->tdhasoid;
25202521
rel->rd_rel->relnatts = natts;
25212522
rel->rd_rel->reltype = InvalidOid;

src/include/catalog/pg_class.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ DESCR("");
147147
#define RELKIND_VIEW 'v' /* view */
148148
#define RELKIND_COMPOSITE_TYPE 'c' /* composite type */
149149
#define RELKIND_FOREIGN_TABLE 'f' /* foreign table */
150-
#define RELKIND_UNCATALOGED 'u' /* not yet cataloged */
151150

152151
#define RELPERSISTENCE_PERMANENT 'p' /* regular table */
153152
#define RELPERSISTENCE_UNLOGGED 'u' /* unlogged permanent table */

src/include/utils/relcache.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ extern Relation RelationBuildLocalRelation(const char *relname,
7070
Oid reltablespace,
7171
bool shared_relation,
7272
bool mapped_relation,
73-
char relpersistence);
73+
char relpersistence,
74+
char relkind);
7475

7576
/*
7677
* Routine to manage assignment of new relfilenode to a relation

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy