AW: Get the name of the target Relation from Query struct?

From: Ernst-Georg Schmid <ernst-georg(dot)schmid(at)bayer(dot)com>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: AW: Get the name of the target Relation from Query struct?
Date: 2018-04-05 13:20:52
Message-ID: 276c4d1f1d8f49cd8dc15677d98504f0@BYEX19.de.bayer.cnb
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thank you David, so I am on the right track.

>If you want the relation name from the OID then you'll need something
>like get_rel_name().

Hm, lsyscache.c says for get_rel_name():

* NOTE: since relation name is not unique, be wary of code that uses this
* for anything except preparing error messages.

How do I get the schema name too, then?

Call get_rel_namespace() and then get_rel_name() again with the Oid that was returned?

Best regards,

Ernst-Georg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-04-05 13:27:47 Re: typcategory for regconfig
Previous Message Alvaro Herrera 2018-04-05 13:17:48 Re: pgsql: Validate page level checksums in base backups