diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-04-02 01:03:07 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-04-02 01:03:07 +0000 |
commit | 1dc43ea75f92d46b137ca5d92de5d9d1ecc34af2 (patch) | |
tree | 6c89a396929b5674be08d15ac80df886e6487a15 /src/backend/utils/cache/lsyscache.c | |
parent | 789ddcb5fe0584fd7524db97909ff43cb2ac37f6 (diff) |
Make VACUUM handle schema-qualified relation names properly.
Diffstat (limited to 'src/backend/utils/cache/lsyscache.c')
-rw-r--r-- | src/backend/utils/cache/lsyscache.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 6ec682f5206..bf0981e6372 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 - * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.67 2002/03/29 19:06:15 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.68 2002/04/02 01:03:07 tgl Exp $ * * NOTES * Eventually, the index information should go through here, too. @@ -17,6 +17,7 @@ #include "access/tupmacs.h" #include "catalog/pg_amop.h" +#include "catalog/pg_namespace.h" #include "catalog/pg_opclass.h" #include "catalog/pg_operator.h" #include "catalog/pg_proc.h" @@ -1279,6 +1280,35 @@ free_attstatsslot(Oid atttype, pfree(numbers); } +/* ---------- PG_NAMESPACE CACHE ---------- */ + +/* + * get_namespace_name + * Returns the name of a given namespace + * + * Returns a palloc'd copy of the string, or NULL if no such namespace. + */ +char * +get_namespace_name(Oid nspid) +{ + HeapTuple tp; + + tp = SearchSysCache(NAMESPACEOID, + ObjectIdGetDatum(nspid), + 0, 0, 0); + if (HeapTupleIsValid(tp)) + { + Form_pg_namespace nsptup = (Form_pg_namespace) GETSTRUCT(tp); + char *result; + + result = pstrdup(NameStr(nsptup->nspname)); + ReleaseSysCache(tp); + return result; + } + else + return NULL; +} + /* ---------- PG_SHADOW CACHE ---------- */ /* |