|
13 | 13 | * Portions Copyright (c) 1994, Regents of the University of California
|
14 | 14 | *
|
15 | 15 | * IDENTIFICATION
|
16 |
| - * $Header: /cvsroot/pgsql/src/backend/catalog/namespace.c,v 1.2 2002/03/29 19:06:01 tgl Exp $ |
| 16 | + * $Header: /cvsroot/pgsql/src/backend/catalog/namespace.c,v 1.3 2002/03/30 01:02:41 tgl Exp $ |
17 | 17 | *
|
18 | 18 | *-------------------------------------------------------------------------
|
19 | 19 | */
|
@@ -81,6 +81,10 @@ RangeVarGetRelid(const RangeVar *relation, bool failOK)
|
81 | 81 | * RangeVarGetCreationNamespace
|
82 | 82 | * Given a RangeVar describing a to-be-created relation,
|
83 | 83 | * choose which namespace to create it in.
|
| 84 | + * |
| 85 | + * Note: calling this may result in a CommandCounterIncrement operation. |
| 86 | + * That will happen on the first request for a temp table in any particular |
| 87 | + * backend run; we will need to either create or clean out the temp schema. |
84 | 88 | */
|
85 | 89 | Oid
|
86 | 90 | RangeVarGetCreationNamespace(const RangeVar *newRelation)
|
@@ -126,6 +130,21 @@ RelnameGetRelid(const char *relname)
|
126 | 130 | return get_relname_relid(relname, PG_CATALOG_NAMESPACE);
|
127 | 131 | }
|
128 | 132 |
|
| 133 | +/* |
| 134 | + * TypenameGetTypid |
| 135 | + * Try to resolve an unqualified datatype name. |
| 136 | + * Returns OID if type found in search path, else InvalidOid. |
| 137 | + */ |
| 138 | +Oid |
| 139 | +TypenameGetTypid(const char *typname) |
| 140 | +{ |
| 141 | + /* XXX wrong, should use namespace search */ |
| 142 | + return GetSysCacheOid(TYPENAMENSP, |
| 143 | + PointerGetDatum(typname), |
| 144 | + ObjectIdGetDatum(PG_CATALOG_NAMESPACE), |
| 145 | + 0, 0); |
| 146 | +} |
| 147 | + |
129 | 148 | /*
|
130 | 149 | * QualifiedNameGetCreationNamespace
|
131 | 150 | * Given a possibly-qualified name for an object (in List-of-Values
|
|
0 commit comments