Remove RELKIND_UNCATALOGED.
authorRobert Haas <rhaas@postgresql.org>
Thu, 14 Jun 2012 13:47:30 +0000 (09:47 -0400)
committerRobert Haas <rhaas@postgresql.org>
Thu, 14 Jun 2012 13:47:30 +0000 (09:47 -0400)
This may have been important at some point in the past, but it no
longer does anything useful.

Review by Tom Lane.

contrib/pgstattuple/pgstattuple.c
src/backend/access/common/reloptions.c
src/backend/catalog/dependency.c
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/catalog/toasting.c
src/backend/commands/indexcmds.c
src/backend/utils/cache/relcache.c
src/include/catalog/pg_class.h
src/include/utils/relcache.h

index 2b62b7850639d4bbaff7ddb4473ea0d671ba06e5..8d4fd8b0c9e00e1c0132f1f5c1ce111337e1da4c 100644 (file)
@@ -217,7 +217,6 @@ pgstat_relation(Relation rel, FunctionCallInfo fcinfo)
    {
        case RELKIND_RELATION:
        case RELKIND_TOASTVALUE:
-       case RELKIND_UNCATALOGED:
        case RELKIND_SEQUENCE:
            return pgstat_heap(rel, fcinfo);
        case RELKIND_INDEX:
index 607a80d7d4a42d8aa0366271fd486832e7150ff4..1eeaadecffe5c30ad40a0c09ce57f78415397b6b 100644 (file)
@@ -790,7 +790,6 @@ extractRelOptions(HeapTuple tuple, TupleDesc tupdesc, Oid amoptions)
        case RELKIND_RELATION:
        case RELKIND_TOASTVALUE:
        case RELKIND_VIEW:
-       case RELKIND_UNCATALOGED:
            options = heap_reloptions(classForm->relkind, datum, false);
            break;
        case RELKIND_INDEX:
index d4e1f76f315bcb58c48f386428956108bf10c766..98ce5981c117f9d2f78b6ef4e01a21e5cd565f67 100644 (file)
@@ -2968,10 +2968,6 @@ getRelationDescription(StringInfo buffer, Oid relid)
            appendStringInfo(buffer, _("sequence %s"),
                             relname);
            break;
-       case RELKIND_UNCATALOGED:
-           appendStringInfo(buffer, _("uncataloged table %s"),
-                            relname);
-           break;
        case RELKIND_TOASTVALUE:
            appendStringInfo(buffer, _("toast table %s"),
                             relname);
index 49e7644699383755529b93461e91558705d17699..c959a469fd6292754913a837f2375e206141abce 100644 (file)
@@ -327,7 +327,8 @@ heap_create(const char *relname,
                                     reltablespace,
                                     shared_relation,
                                     mapped_relation,
-                                    relpersistence);
+                                    relpersistence,
+                                    relkind);
 
    /*
     * Have the storage manager create the relation's disk file, if needed.
@@ -889,7 +890,6 @@ AddNewRelationTuple(Relation pg_class_desc,
    new_rel_reltup->relowner = relowner;
    new_rel_reltup->reltype = new_type_oid;
    new_rel_reltup->reloftype = reloftype;
-   new_rel_reltup->relkind = relkind;
 
    new_rel_desc->rd_att->tdtypeid = new_type_oid;
 
index 9e8b1cc49bc0cbd4d94e3cc4fa802ca59395a68b..89d346886d4e7d012fdf8b75db0329794ab85862 100644 (file)
@@ -836,7 +836,6 @@ index_create(Relation heapRelation,
     */
    indexRelation->rd_rel->relowner = heapRelation->rd_rel->relowner;
    indexRelation->rd_rel->relam = accessMethodObjectId;
-   indexRelation->rd_rel->relkind = RELKIND_INDEX;
    indexRelation->rd_rel->relhasoids = false;
 
    /*
index 707ba7e28373dace9ee7428542e391b0697aabe3..1feffd25efa149795619046b437c20364d853acb 100644 (file)
@@ -84,9 +84,7 @@ BootstrapToastTable(char *relName, Oid toastOid, Oid toastIndexOid)
 
    rel = heap_openrv(makeRangeVar(NULL, relName, -1), AccessExclusiveLock);
 
-   /* Note: during bootstrap may see uncataloged relation */
-   if (rel->rd_rel->relkind != RELKIND_RELATION &&
-       rel->rd_rel->relkind != RELKIND_UNCATALOGED)
+   if (rel->rd_rel->relkind != RELKIND_RELATION)
        ereport(ERROR,
                (errcode(ERRCODE_WRONG_OBJECT_TYPE),
                 errmsg("\"%s\" is not a table",
index a68d500e5b42c374fa87c6e7e410b52a550118a0..1f9bf618904623dcbdf5b4caac59449456af725a 100644 (file)
@@ -378,9 +378,7 @@ DefineIndex(RangeVar *heapRelation,
    relationId = RelationGetRelid(rel);
    namespaceId = RelationGetNamespace(rel);
 
-   /* Note: during bootstrap may see uncataloged relation */
-   if (rel->rd_rel->relkind != RELKIND_RELATION &&
-       rel->rd_rel->relkind != RELKIND_UNCATALOGED)
+   if (rel->rd_rel->relkind != RELKIND_RELATION)
    {
        if (rel->rd_rel->relkind == RELKIND_FOREIGN_TABLE)
 
index 4cbf812ed594b4ca291d7662fa2bd47f34f131cc..2e6776e78f76a8b20467a144f9ebe98956b9da6a 100644 (file)
@@ -2409,7 +2409,8 @@ RelationBuildLocalRelation(const char *relname,
                           Oid reltablespace,
                           bool shared_relation,
                           bool mapped_relation,
-                          char relpersistence)
+                          char relpersistence,
+                          char relkind)
 {
    Relation    rel;
    MemoryContext oldcxt;
@@ -2515,7 +2516,7 @@ RelationBuildLocalRelation(const char *relname,
    namestrcpy(&rel->rd_rel->relname, relname);
    rel->rd_rel->relnamespace = relnamespace;
 
-   rel->rd_rel->relkind = RELKIND_UNCATALOGED;
+   rel->rd_rel->relkind = relkind;
    rel->rd_rel->relhasoids = rel->rd_att->tdhasoid;
    rel->rd_rel->relnatts = natts;
    rel->rd_rel->reltype = InvalidOid;
index 1567206a7e0c0187cceccb650b9a7eadcfdcc59a..a3307b44337e667280305562d82a63368c83821e 100644 (file)
@@ -147,7 +147,6 @@ DESCR("");
 #define          RELKIND_VIEW            'v'       /* view */
 #define          RELKIND_COMPOSITE_TYPE  'c'       /* composite type */
 #define          RELKIND_FOREIGN_TABLE   'f'       /* foreign table */
-#define          RELKIND_UNCATALOGED     'u'       /* not yet cataloged */
 
 #define          RELPERSISTENCE_PERMANENT  'p'     /* regular table */
 #define          RELPERSISTENCE_UNLOGGED   'u'     /* unlogged permanent table */
index 2f39486c97450b6081c1de3415e4a128ae8ad470..abbc9ca16ab62aeb6162c078a6fed7087ce7811d 100644 (file)
@@ -70,7 +70,8 @@ extern Relation RelationBuildLocalRelation(const char *relname,
                           Oid reltablespace,
                           bool shared_relation,
                           bool mapped_relation,
-                          char relpersistence);
+                          char relpersistence,
+                          char relkind);
 
 /*
  * Routine to manage assignment of new relfilenode to a relation