> > scan_relid != InvalidOid > > > > Ideally, they should be OidIsValid(scan_relid) > Scan.scanrelid is an index of range-tables list, not an object-id. So, InvalidOid or OidIsValid() are not a good choice.
The bare relation oid has to be saved on relid of RangeTblEntry which can be pulled using rt_fetch(scanrelid, range_tables). I could found an assertion below at ExecScanFetch(). Assert(scanrelid > 0); Probably, it is a usual manner for this. Thanks, -- NEC OSS Promotion Center / PG-Strom Project KaiGai Kohei <kai...@ak.jp.nec.com> > -----Original Message----- > From: Petr Jelinek [mailto:p...@2ndquadrant.com] > Sent: Wednesday, January 07, 2015 8:24 AM > To: Jim Nasby; Kaigai Kouhei(海外 浩平); Robert Haas > Cc: Tom Lane; pgsql-hackers@postgreSQL.org; Shigeru Hanada > Subject: Re: Custom/Foreign-Join-APIs (Re: [HACKERS] [v9.5] Custom Plan > API) > > On 07/01/15 00:05, Jim Nasby wrote: > > On 1/6/15, 8:17 AM, Kouhei Kaigai wrote: > >> The attached patch is newer revision of custom-/foreign-join > >> interface. > > > > Shouldn't instances of > > > > scan_relid > 0 > > > > be > > > > scan_relid != InvalidOid > > > > Ideally, they should be OidIsValid(scan_relid) > > > -- > Petr Jelinek http://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers