Re: intermittent error: 'variable not found in subplan target list' - Mailing list pgsql-bugs

From Tom Lane
Subject Re: intermittent error: 'variable not found in subplan target list'
Date
Msg-id 23455.1077918599@sss.pgh.pa.us
Whole thread Raw
List pgsql-bugs
Damon Hart <dhcom@sundial.com> writes:
> Thanks for your response, the full original post follows, including both
> scripts.

Found it.  The patch for 7.4.* is attached.  It will appear in 7.4.2.

            regards, tom lane

Index: src/backend/optimizer/plan/initsplan.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/optimizer/plan/initsplan.c,v
retrieving revision 1.91.2.1
diff -c -r1.91.2.1 initsplan.c
*** src/backend/optimizer/plan/initsplan.c    5 Nov 2003 22:00:52 -0000    1.91.2.1
--- src/backend/optimizer/plan/initsplan.c    27 Feb 2004 21:38:40 -0000
***************
*** 768,778 ****
                   errmsg("equality operator for types %s and %s should be merge-joinable, but isn't",
                          format_type_be(ltype), format_type_be(rtype))));

      clause = make_opclause(oprid(eq_operator),    /* opno */
                             BOOLOID,        /* opresulttype */
                             false,        /* opretset */
!                            (Expr *) item1,
!                            (Expr *) item2);

      ReleaseSysCache(eq_operator);

--- 768,783 ----
                   errmsg("equality operator for types %s and %s should be merge-joinable, but isn't",
                          format_type_be(ltype), format_type_be(rtype))));

+     /*
+      * Now we can build the new clause.  Copy to ensure it shares no
+      * substructure with original (this is necessary in case there are
+      * subselects in there...)
+      */
      clause = make_opclause(oprid(eq_operator),    /* opno */
                             BOOLOID,        /* opresulttype */
                             false,        /* opretset */
!                            (Expr *) copyObject(item1),
!                            (Expr *) copyObject(item2));

      ReleaseSysCache(eq_operator);

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #1086: lower and upper functions
Next
From: "PostgreSQL Bugs List"
Date:
Subject: BUG #1087: psql dumps core on CTRL+ALT+\