Skip to content

Commit 3d58a1c

Browse files
committed
Remove traces of otherwise unused RELKIND_SPECIAL symbol. Leave the psql bits
in place though, so that it plays nicely with older servers. Per discussion.
1 parent 22b118b commit 3d58a1c

File tree

6 files changed

+19
-25
lines changed

6 files changed

+19
-25
lines changed

doc/src/sgml/catalogs.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.122 2006/05/02 22:25:09 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.123 2006/05/28 02:27:08 alvherre Exp $ -->
22
<!--
33
Documentation of the system catalogs, directed toward PostgreSQL developers
44
-->
@@ -1386,7 +1386,7 @@
13861386
everything else that has columns or is otherwise similar to a
13871387
table. This includes indexes (but see also
13881388
<structname>pg_index</structname>), sequences, views, composite types,
1389-
and some kinds of special relation; see <structfield>relkind</>.
1389+
and TOAST tables; see <structfield>relkind</>.
13901390
Below, when we mean all of these
13911391
kinds of objects we speak of <quote>relations</quote>. Not all
13921392
columns are meaningful for all relation types.
@@ -1540,7 +1540,7 @@
15401540
<entry>
15411541
<literal>r</> = ordinary table, <literal>i</> = index,
15421542
<literal>S</> = sequence, <literal>v</> = view, <literal>c</> =
1543-
composite type, <literal>s</> = special, <literal>t</> = TOAST
1543+
composite type, <literal>t</> = TOAST
15441544
table
15451545
</entry>
15461546
</row>

src/backend/access/heap/heapam.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.212 2006/05/10 23:18:39 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.213 2006/05/28 02:27:08 alvherre Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -794,8 +794,8 @@ relation_close(Relation relation, LOCKMODE lockmode)
794794
* heap_open - open a heap relation by relation OID
795795
*
796796
* This is essentially relation_open plus check that the relation
797-
* is not an index or special relation. (The caller should also check
798-
* that it's not a view before assuming it has storage.)
797+
* is not an index nor a composite type. (The caller should also
798+
* check that it's not a view before assuming it has storage.)
799799
* ----------------
800800
*/
801801
Relation
@@ -810,11 +810,6 @@ heap_open(Oid relationId, LOCKMODE lockmode)
810810
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
811811
errmsg("\"%s\" is an index",
812812
RelationGetRelationName(r))));
813-
else if (r->rd_rel->relkind == RELKIND_SPECIAL)
814-
ereport(ERROR,
815-
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
816-
errmsg("\"%s\" is a special relation",
817-
RelationGetRelationName(r))));
818813
else if (r->rd_rel->relkind == RELKIND_COMPOSITE_TYPE)
819814
ereport(ERROR,
820815
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
@@ -845,11 +840,6 @@ heap_openrv(const RangeVar *relation, LOCKMODE lockmode)
845840
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
846841
errmsg("\"%s\" is an index",
847842
RelationGetRelationName(r))));
848-
else if (r->rd_rel->relkind == RELKIND_SPECIAL)
849-
ereport(ERROR,
850-
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
851-
errmsg("\"%s\" is a special relation",
852-
RelationGetRelationName(r))));
853843
else if (r->rd_rel->relkind == RELKIND_COMPOSITE_TYPE)
854844
ereport(ERROR,
855845
(errcode(ERRCODE_WRONG_OBJECT_TYPE),

src/backend/catalog/dependency.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/catalog/dependency.c,v 1.53 2006/04/30 01:08:06 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/catalog/dependency.c,v 1.54 2006/05/28 02:27:08 alvherre Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1898,10 +1898,6 @@ getRelationDescription(StringInfo buffer, Oid relid)
18981898
appendStringInfo(buffer, _("index %s"),
18991899
relname);
19001900
break;
1901-
case RELKIND_SPECIAL:
1902-
appendStringInfo(buffer, _("special system relation %s"),
1903-
relname);
1904-
break;
19051901
case RELKIND_SEQUENCE:
19061902
appendStringInfo(buffer, _("sequence %s"),
19071903
relname);

src/bin/psql/describe.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.135 2006/05/26 23:48:54 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.136 2006/05/28 02:27:08 alvherre Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "describe.h"
@@ -881,6 +881,7 @@ describeOneTableDetails(const char *schemaname,
881881
schemaname, relationname);
882882
break;
883883
case 's':
884+
/* not used as of 8.2, but keep it for backwards compatibility */
884885
printfPQExpBuffer(&title, _("Special relation \"%s.%s\""),
885886
schemaname, relationname);
886887
break;
@@ -1471,6 +1472,10 @@ listTables(const char *tabtypes, const char *pattern, bool verbose)
14711472

14721473
initPQExpBuffer(&buf);
14731474

1475+
/*
1476+
* Note: as of Pg 8.2, we no longer use relkind 's', but we keep it here
1477+
* for backwards compatibility.
1478+
*/
14741479
printfPQExpBuffer(&buf,
14751480
"SELECT n.nspname as \"%s\",\n"
14761481
" c.relname as \"%s\",\n"

src/bin/psql/tab-complete.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.151 2006/04/30 21:15:33 tgl Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.152 2006/05/28 02:27:08 alvherre Exp $
77
*/
88

99
/*----------------------------------------------------------------------
@@ -370,6 +370,10 @@ static const SchemaQuery Query_for_list_of_views = {
370370
" UNION ALL SELECT 'all') ss "\
371371
" WHERE substring(name,1,%d)='%s'"
372372

373+
/*
374+
* Note: As of Pg 8.2, we no longer use relkind 's', but we keep it here
375+
* for compatibility with older servers
376+
*/
373377
#define Query_for_list_of_system_relations \
374378
"SELECT pg_catalog.quote_ident(relname) "\
375379
" FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n "\

src/include/catalog/pg_class.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $PostgreSQL: pgsql/src/include/catalog/pg_class.h,v 1.91 2006/03/05 15:58:54 momjian Exp $
11+
* $PostgreSQL: pgsql/src/include/catalog/pg_class.h,v 1.92 2006/05/28 02:27:08 alvherre Exp $
1212
*
1313
* NOTES
1414
* the genbki.sh script reads this file and generates .bki
@@ -150,7 +150,6 @@ DESCR("");
150150

151151
#define RELKIND_INDEX 'i' /* secondary index */
152152
#define RELKIND_RELATION 'r' /* ordinary cataloged heap */
153-
#define RELKIND_SPECIAL 's' /* special (non-heap) */
154153
#define RELKIND_SEQUENCE 'S' /* SEQUENCE relation */
155154
#define RELKIND_UNCATALOGED 'u' /* temporary heap */
156155
#define RELKIND_TOASTVALUE 't' /* moved off huge values */

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