Re: [doc] improve tableoid description

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
To: Ian Lawrence Barwick <barwick(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [doc] improve tableoid description
Date: 2020-10-19 11:22:04
Message-ID: CAExHW5s3Qvk6oD9gsP3Mc0=Ad9pzVKZxhWtjN=4O66omR7D6GQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Oct 17, 2020 at 6:35 PM Ian Lawrence Barwick <barwick(at)gmail(dot)com> wrote:
>
> [doc] improve tableoid description
>
> Hi
>
> Attached patch aims to improve the description of the tableoid system column [1]
> by:
>
> - mentioning it's useful for determining table names for partitioned tables as
> well as for those in inheritance hierarchies

This looks fine.

> - mentioning the possibility of casting tableoid to regclass (which is simpler
> than the currently suggested join on pg_class, which is only needed if
> the schema name is absolutely required)

Mentioning casting to regclass is worthwhile but it's not performance
efficient if there are many tableoids. In that case, joining with
pg_class.oid is quite efficient. That line further suggests using
regnamespace which is not as efficient as joining with
pg_namespace.oid. But pg_namespace won't have as many entries as
pg_class so casting to regnamespace might be fine. Should we suggest
both the methods somehow?

--
Best Wishes,
Ashutosh Bapat

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amul Sul 2020-10-19 11:28:22 Assertion failure when ATTACH partition followed by CREATE PARTITION.
Previous Message Andrew Dunstan 2020-10-19 11:15:48 Re: Make procedure OUT parameters work with JDBC