From da395b56cd0844f73232961fe0823f4c224bc721 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 19 Sep 2002 23:40:56 +0000 Subject: Tweak heap.c to refuse attempts to create table columns of standalone composite types. Add a couple more lsyscache.c routines to support this, and make use of them in some other places that were doing lookups the hard way. --- src/backend/utils/adt/ruleutils.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/backend/utils/adt/ruleutils.c') diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 47f61865fc3..796eaa05069 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -3,7 +3,7 @@ * back to source text * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.123 2002/09/19 22:48:33 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.124 2002/09/19 23:40:56 tgl Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -2087,24 +2087,14 @@ get_rule_expr(Node *node, deparse_context *context, { FieldSelect *fselect = (FieldSelect *) node; Oid argType = exprType(fselect->arg); - HeapTuple typetup; - Form_pg_type typeStruct; Oid typrelid; char *fieldname; /* lookup arg type and get the field name */ - typetup = SearchSysCache(TYPEOID, - ObjectIdGetDatum(argType), - 0, 0, 0); - if (!HeapTupleIsValid(typetup)) - elog(ERROR, "cache lookup of type %u failed", - argType); - typeStruct = (Form_pg_type) GETSTRUCT(typetup); - typrelid = typeStruct->typrelid; + typrelid = get_typ_typrelid(argType); if (!OidIsValid(typrelid)) elog(ERROR, "Argument type %s of FieldSelect is not a tuple type", format_type_be(argType)); - ReleaseSysCache(typetup); fieldname = get_relid_attribute_name(typrelid, fselect->fieldnum); -- cgit v1.2.3