mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Remove 'func_tlist' from Func expression nodes, likewise 'param_tlist'
from Param nodes, per discussion a few days ago on pghackers. Add new expression node type FieldSelect that implements the functionality where it's actually needed. Clean up some other unused fields in Func nodes as well. NOTE: initdb forced due to change in stored expression trees for rules.
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
* out of its tuple
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.57 2000/07/06 23:03:37 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.58 2000/08/08 15:42:21 tgl Exp $
|
||||
*
|
||||
* This software is copyrighted by Jan Wieck - Hamburg.
|
||||
*
|
||||
@ -1430,6 +1430,32 @@ get_rule_expr(Node *node, deparse_context *context)
|
||||
}
|
||||
break;
|
||||
|
||||
case T_FieldSelect:
|
||||
{
|
||||
FieldSelect *fselect = (FieldSelect *) node;
|
||||
HeapTuple typetup;
|
||||
Form_pg_type typeStruct;
|
||||
Oid typrelid;
|
||||
char *fieldname;
|
||||
|
||||
/* we do NOT parenthesize the arg expression, for now */
|
||||
get_rule_expr(fselect->arg, context);
|
||||
typetup = SearchSysCacheTuple(TYPEOID,
|
||||
ObjectIdGetDatum(exprType(fselect->arg)),
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(typetup))
|
||||
elog(ERROR, "cache lookup of type %u failed",
|
||||
exprType(fselect->arg));
|
||||
typeStruct = (Form_pg_type) GETSTRUCT(typetup);
|
||||
typrelid = typeStruct->typrelid;
|
||||
if (!OidIsValid(typrelid))
|
||||
elog(ERROR, "Argument type %s of FieldSelect is not a tuple type",
|
||||
NameStr(typeStruct->typname));
|
||||
fieldname = get_attribute_name(typrelid, fselect->fieldnum);
|
||||
appendStringInfo(buf, ".%s", quote_identifier(fieldname));
|
||||
}
|
||||
break;
|
||||
|
||||
case T_RelabelType:
|
||||
{
|
||||
RelabelType *relabel = (RelabelType *) node;
|
||||
|
Reference in New Issue
Block a user