summaryrefslogtreecommitdiff
path: root/src/backend/utils/cache/lsyscache.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-11-05 19:17:13 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-11-05 19:17:13 +0000
commit98e8b4805324d8ba0b196b8ffaafd5ddd3051ea1 (patch)
tree61d027f5621f3ff37a675fb2e9982e0d28a81242 /src/backend/utils/cache/lsyscache.c
parent0ed3c7665e2fe46efd3eef936a1265be2ec6707f (diff)
Create 'default_tablespace' GUC variable that supplies a TABLESPACE
clause implicitly whenever one is not given explicitly. Remove concept of a schema having an associated tablespace, and simplify the rules for selecting a default tablespace for a table or index. It's now just (a) explicit TABLESPACE clause; (b) default_tablespace if that's not an empty string; (c) database's default. This will allow pg_dump to use SET commands instead of tablespace clauses to determine object locations (but I didn't actually make it do so). All per recent discussions.
Diffstat (limited to 'src/backend/utils/cache/lsyscache.c')
-rw-r--r--src/backend/utils/cache/lsyscache.c58
1 files changed, 1 insertions, 57 deletions
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c
index 2e3848947c8..3e63efcc4f6 100644
--- a/src/backend/utils/cache/lsyscache.c
+++ b/src/backend/utils/cache/lsyscache.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/lsyscache.c,v 1.117 2004/10/20 16:04:49 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/lsyscache.c,v 1.118 2004/11/05 19:16:14 tgl Exp $
*
* NOTES
* Eventually, the index information should go through here, too.
@@ -986,34 +986,6 @@ get_rel_namespace(Oid relid)
}
/*
- * get_rel_tablespace
- * Returns the pg_tablespace OID associated with a given relation.
- *
- * Note: failure return is InvalidOid, which cannot be distinguished from
- * "default tablespace for this database", but that seems OK.
- */
-Oid
-get_rel_tablespace(Oid relid)
-{
- HeapTuple tp;
-
- tp = SearchSysCache(RELOID,
- ObjectIdGetDatum(relid),
- 0, 0, 0);
- if (HeapTupleIsValid(tp))
- {
- Form_pg_class reltup = (Form_pg_class) GETSTRUCT(tp);
- Oid result;
-
- result = reltup->reltablespace;
- ReleaseSysCache(tp);
- return result;
- }
- else
- return InvalidOid;
-}
-
-/*
* get_rel_type_id
*
* Returns the pg_type OID associated with a given relation.
@@ -2044,34 +2016,6 @@ get_namespace_name(Oid nspid)
return NULL;
}
-/*
- * get_namespace_tablespace
- * Returns the default tablespace of a given namespace
- *
- * Note: failure return is InvalidOid, which cannot be distinguished from
- * "default tablespace for this database", but that seems OK.
- */
-Oid
-get_namespace_tablespace(Oid nspid)
-{
- HeapTuple tp;
-
- tp = SearchSysCache(NAMESPACEOID,
- ObjectIdGetDatum(nspid),
- 0, 0, 0);
- if (HeapTupleIsValid(tp))
- {
- Form_pg_namespace nsptup = (Form_pg_namespace) GETSTRUCT(tp);
- Oid result;
-
- result = nsptup->nsptablespace;
- ReleaseSysCache(tp);
- return result;
- }
- else
- return InvalidOid;
-}
-
/* ---------- PG_SHADOW CACHE ---------- */
/*