diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-03-29 19:06:29 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-03-29 19:06:29 +0000 |
commit | d5e99ab4d6718e8ef515575e33fb5c6181cdcc96 (patch) | |
tree | 6c817d6358f50ae920207245c3b862b2cdd74ceb /src/backend/utils/cache/lsyscache.c | |
parent | 7c1ff354105e2256d7904497d8e282ccec53d2e6 (diff) | |
download | postgresql-d5e99ab4d6718e8ef515575e33fb5c6181cdcc96.tar.gz postgresql-d5e99ab4d6718e8ef515575e33fb5c6181cdcc96.zip |
pg_type has a typnamespace column; system now supports creating types
in different namespaces. Also, cleanup work on relation namespace
support: drop, alter, rename commands work for tables in non-default
namespaces.
Diffstat (limited to 'src/backend/utils/cache/lsyscache.c')
-rw-r--r-- | src/backend/utils/cache/lsyscache.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 82be75ac799..6ec682f5206 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.66 2002/03/26 19:16:09 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.67 2002/03/29 19:06:15 tgl Exp $ * * NOTES * Eventually, the index information should go through here, too. @@ -739,6 +739,33 @@ get_rel_type_id(Oid relid) /* ---------- TYPE CACHE ---------- */ /* + * get_typisdefined + * + * Given the type OID, determine whether the type is defined + * (if not, it's only a shell). + */ +bool +get_typisdefined(Oid typid) +{ + HeapTuple tp; + + tp = SearchSysCache(TYPEOID, + ObjectIdGetDatum(typid), + 0, 0, 0); + if (HeapTupleIsValid(tp)) + { + Form_pg_type typtup = (Form_pg_type) GETSTRUCT(tp); + bool result; + + result = typtup->typisdefined; + ReleaseSysCache(tp); + return result; + } + else + return false; +} + +/* * get_typlen * * Given the type OID, return the length of the type. |