8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/backend/parser/parse_func.c,v 1.171 2004/06/16 01:26:45 tgl Exp $
11
+ * $PostgreSQL: pgsql/src/backend/parser/parse_func.c,v 1.172 2004/06/19 18:19:55 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -38,7 +38,6 @@ static Oid **argtype_inherit(int nargs, Oid *argtypes);
38
38
39
39
static int find_inheritors (Oid relid , Oid * * supervec );
40
40
static Oid * * gen_cross_product (InhPaths * arginh , int nargs );
41
- static FieldSelect * setup_field_select (Node * input , char * attname , Oid relid );
42
41
static void unknown_attribute (ParseState * pstate , Node * relref , char * attname );
43
42
44
43
@@ -1131,33 +1130,6 @@ make_fn_arguments(ParseState *pstate,
1131
1130
}
1132
1131
}
1133
1132
1134
- /*
1135
- * setup_field_select
1136
- * Build a FieldSelect node that says which attribute to project to.
1137
- * This routine is called by ParseFuncOrColumn() when we have found
1138
- * a projection on a function result or parameter.
1139
- */
1140
- static FieldSelect *
1141
- setup_field_select (Node * input , char * attname , Oid relid )
1142
- {
1143
- FieldSelect * fselect = makeNode (FieldSelect );
1144
- AttrNumber attno ;
1145
-
1146
- attno = get_attnum (relid , attname );
1147
- if (attno == InvalidAttrNumber )
1148
- ereport (ERROR ,
1149
- (errcode (ERRCODE_UNDEFINED_COLUMN ),
1150
- errmsg ("column \"%s\" of relation \"%s\" does not exist" ,
1151
- attname , get_rel_name (relid ))));
1152
-
1153
- fselect -> arg = (Expr * ) input ;
1154
- fselect -> fieldnum = attno ;
1155
- fselect -> resulttype = get_atttype (relid , attno );
1156
- fselect -> resulttypmod = get_atttypmod (relid , attno );
1157
-
1158
- return fselect ;
1159
- }
1160
-
1161
1133
/*
1162
1134
* ParseComplexProjection -
1163
1135
* handles function calls with a single argument that is of complex type.
@@ -1170,6 +1142,7 @@ ParseComplexProjection(ParseState *pstate, char *funcname, Node *first_arg)
1170
1142
Oid argtype ;
1171
1143
Oid argrelid ;
1172
1144
AttrNumber attnum ;
1145
+ FieldSelect * fselect ;
1173
1146
1174
1147
/*
1175
1148
* Special case for whole-row Vars so that we can resolve (foo.*).bar
@@ -1205,7 +1178,14 @@ ParseComplexProjection(ParseState *pstate, char *funcname, Node *first_arg)
1205
1178
return NULL ; /* funcname does not match any column */
1206
1179
1207
1180
/* Success, so generate a FieldSelect expression */
1208
- return (Node * ) setup_field_select (first_arg , funcname , argrelid );
1181
+ fselect = makeNode (FieldSelect );
1182
+ fselect -> arg = (Expr * ) first_arg ;
1183
+ fselect -> fieldnum = attnum ;
1184
+ get_atttypetypmod (argrelid , attnum ,
1185
+ & fselect -> resulttype ,
1186
+ & fselect -> resulttypmod );
1187
+
1188
+ return (Node * ) fselect ;
1209
1189
}
1210
1190
1211
1191
/*
0 commit comments