mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +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:
@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user