Re: UNION ALL - Var attno - Mailing list pgsql-hackers

From Tom Lane
Subject Re: UNION ALL - Var attno
Date
Msg-id 12413.1461936923@sss.pgh.pa.us
Whole thread Raw
In response to Re: UNION ALL - Var attno  (sri harsha <sriharsha9992@gmail.com>)
List pgsql-hackers
sri harsha <sriharsha9992@gmail.com> writes:
> Its not an OpExpr . It is a VAR , got it from "reltargetlist" in base
> relation ( RelOptInfo) .

Read the comment:
*        reltargetlist - List of Var and PlaceHolderVar nodes for the values*                        we need to output
fromthis relation.*                        List is in no particular order, but all rels of an*
appendrelset must use corresponding orders.*                        NOTE: in an appendrel child relation, may contain*
                     arbitrary expressions pulled up from a subquery!
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In general, it's seldom a good idea to assume that a Node is of a specific
type without having confirmed that with an IsA() check.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Christian Ullrich
Date:
Subject: Re: pgsql: Support building with Visual Studio 2015
Next
From: Tom Lane
Date:
Subject: Re: [sqlsmith] Failed assertion in BecomeLockGroupLeader