1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Make the world safe for passing whole rows of views to functions. This

already worked fine for whole rows of tables, but not so well for views...
This commit is contained in:
Tom Lane
2001-04-18 20:42:56 +00:00
parent e4c06b2125
commit d5096af2c4
7 changed files with 161 additions and 44 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.56 2001/03/22 03:59:44 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteManip.c,v 1.57 2001/04/18 20:42:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -765,8 +765,13 @@ ResolveNew_mutator(Node *node, ResolveNew_context *context)
if (this_varno == context->target_varno &&
this_varlevelsup == context->sublevels_up)
{
Node *n = FindMatchingNew(context->targetlist,
var->varattno);
Node *n;
/* band-aid: don't do the wrong thing with a whole-tuple Var */
if (var->varattno == InvalidAttrNumber)
elog(ERROR, "ResolveNew: can't handle whole-tuple reference");
n = FindMatchingNew(context->targetlist, var->varattno);
if (n == NULL)
{