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.
This commit is contained in:
Alvaro Herrera 2006-05-28 02:27:08 +00:00
parent 22b118b530
commit 3d58a1c168
6 changed files with 19 additions and 25 deletions

View File

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

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.212 2006/05/10 23:18:39 tgl Exp $
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.213 2006/05/28 02:27:08 alvherre Exp $
*
*
* INTERFACE ROUTINES
@ -794,8 +794,8 @@ relation_close(Relation relation, LOCKMODE lockmode)
* heap_open - open a heap relation by relation OID
*
* This is essentially relation_open plus check that the relation
* is not an index or special relation. (The caller should also check
* that it's not a view before assuming it has storage.)
* is not an index nor a composite type. (The caller should also
* check that it's not a view before assuming it has storage.)
* ----------------
*/
Relation
@ -810,11 +810,6 @@ heap_open(Oid relationId, LOCKMODE lockmode)
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("\"%s\" is an index",
RelationGetRelationName(r))));
else if (r->rd_rel->relkind == RELKIND_SPECIAL)
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("\"%s\" is a special relation",
RelationGetRelationName(r))));
else if (r->rd_rel->relkind == RELKIND_COMPOSITE_TYPE)
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
@ -845,11 +840,6 @@ heap_openrv(const RangeVar *relation, LOCKMODE lockmode)
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("\"%s\" is an index",
RelationGetRelationName(r))));
else if (r->rd_rel->relkind == RELKIND_SPECIAL)
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("\"%s\" is a special relation",
RelationGetRelationName(r))));
else if (r->rd_rel->relkind == RELKIND_COMPOSITE_TYPE)
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),

View File

@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/dependency.c,v 1.53 2006/04/30 01:08:06 momjian Exp $
* $PostgreSQL: pgsql/src/backend/catalog/dependency.c,v 1.54 2006/05/28 02:27:08 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
@ -1898,10 +1898,6 @@ getRelationDescription(StringInfo buffer, Oid relid)
appendStringInfo(buffer, _("index %s"),
relname);
break;
case RELKIND_SPECIAL:
appendStringInfo(buffer, _("special system relation %s"),
relname);
break;
case RELKIND_SEQUENCE:
appendStringInfo(buffer, _("sequence %s"),
relname);

View File

@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.135 2006/05/26 23:48:54 momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.136 2006/05/28 02:27:08 alvherre Exp $
*/
#include "postgres_fe.h"
#include "describe.h"
@ -881,6 +881,7 @@ describeOneTableDetails(const char *schemaname,
schemaname, relationname);
break;
case 's':
/* not used as of 8.2, but keep it for backwards compatibility */
printfPQExpBuffer(&title, _("Special relation \"%s.%s\""),
schemaname, relationname);
break;
@ -1471,6 +1472,10 @@ listTables(const char *tabtypes, const char *pattern, bool verbose)
initPQExpBuffer(&buf);
/*
* Note: as of Pg 8.2, we no longer use relkind 's', but we keep it here
* for backwards compatibility.
*/
printfPQExpBuffer(&buf,
"SELECT n.nspname as \"%s\",\n"
" c.relname as \"%s\",\n"

View File

@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.151 2006/04/30 21:15:33 tgl Exp $
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.152 2006/05/28 02:27:08 alvherre Exp $
*/
/*----------------------------------------------------------------------
@ -370,6 +370,10 @@ static const SchemaQuery Query_for_list_of_views = {
" UNION ALL SELECT 'all') ss "\
" WHERE substring(name,1,%d)='%s'"
/*
* Note: As of Pg 8.2, we no longer use relkind 's', but we keep it here
* for compatibility with older servers
*/
#define Query_for_list_of_system_relations \
"SELECT pg_catalog.quote_ident(relname) "\
" FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n "\

View File

@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/catalog/pg_class.h,v 1.91 2006/03/05 15:58:54 momjian Exp $
* $PostgreSQL: pgsql/src/include/catalog/pg_class.h,v 1.92 2006/05/28 02:27:08 alvherre Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@ -150,7 +150,6 @@ DESCR("");
#define RELKIND_INDEX 'i' /* secondary index */
#define RELKIND_RELATION 'r' /* ordinary cataloged heap */
#define RELKIND_SPECIAL 's' /* special (non-heap) */
#define RELKIND_SEQUENCE 'S' /* SEQUENCE relation */
#define RELKIND_UNCATALOGED 'u' /* temporary heap */
#define RELKIND_TOASTVALUE 't' /* moved off huge values */