Get the name of the target Relation from Query struct?

From: Ernst-Georg Schmid <ernst-georg(dot)schmid(at)bayer(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Get the name of the target Relation from Query struct?
Date: 2018-04-05 10:34:55
Message-ID: 2f1e36ff7e7a4149822c75503d9b30f3@BYEX19.de.bayer.cnb
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

I want to get the target Relation name for a UPDATE / INSERT / DELETE in a planner_hook. Do I understand struct Query correctly that:

Query->resultRelation will be the index into Query->rtable to give me the target Relation?

And if yes, what would rtable give me as list entry? An OID or a Relation or something else?

Best regards,

Ernst-Georg

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2018-04-05 11:02:27 Re: pgsql: Validate page level checksums in base backups
Previous Message Pavan Deolasee 2018-04-05 10:31:34 Re: Add support for printing/reading MergeAction nodes