diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-03-30 01:02:42 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-03-30 01:02:42 +0000 |
commit | 5f4745adf4fb2a1f933b25d7a2bc72b39fa9edfd (patch) | |
tree | e024d7d1a3eb76220378e4054bf34485812962ea /src/backend/catalog/namespace.c | |
parent | 25004eec957853a55789398d4228d7e77d4877c1 (diff) |
Further cleanups for relations in schemas: teach nextval and other
sequence functions how to cope with qualified names. Same code is
also used for int4notin, currtid_byrelname, pgstattuple. Also,
move TOAST tables into special pg_toast namespace.
Diffstat (limited to 'src/backend/catalog/namespace.c')
-rw-r--r-- | src/backend/catalog/namespace.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/backend/catalog/namespace.c b/src/backend/catalog/namespace.c index a1ea6ed24fe..e245ae5a3e4 100644 --- a/src/backend/catalog/namespace.c +++ b/src/backend/catalog/namespace.c @@ -13,7 +13,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/namespace.c,v 1.2 2002/03/29 19:06:01 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/namespace.c,v 1.3 2002/03/30 01:02:41 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -81,6 +81,10 @@ RangeVarGetRelid(const RangeVar *relation, bool failOK) * RangeVarGetCreationNamespace * Given a RangeVar describing a to-be-created relation, * choose which namespace to create it in. + * + * Note: calling this may result in a CommandCounterIncrement operation. + * That will happen on the first request for a temp table in any particular + * backend run; we will need to either create or clean out the temp schema. */ Oid RangeVarGetCreationNamespace(const RangeVar *newRelation) @@ -127,6 +131,21 @@ RelnameGetRelid(const char *relname) } /* + * TypenameGetTypid + * Try to resolve an unqualified datatype name. + * Returns OID if type found in search path, else InvalidOid. + */ +Oid +TypenameGetTypid(const char *typname) +{ + /* XXX wrong, should use namespace search */ + return GetSysCacheOid(TYPENAMENSP, + PointerGetDatum(typname), + ObjectIdGetDatum(PG_CATALOG_NAMESPACE), + 0, 0); +} + +/* * QualifiedNameGetCreationNamespace * Given a possibly-qualified name for an object (in List-of-Values * format), determine what namespace the object should be created in. |