Re: [doc] improve tableoid description

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

2020年10月19日(月) 20:22 Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>:
>
> 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.

True.

> 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?

On further reflection, I think trying to explain all that is going to
end up as a
mini-tutorial which is beyond the scope of the explanation of a column, so
the existing reference to pg_class should be enough.

Revised patch attached just mentioning partitioned tables.

Regards

Ian Barwick

--
EnterpriseDB: https://www.enterprisedb.com

Attachment Content-Type Size
doc-tableoid-regclass.v2.patch text/x-patch 698 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2020-10-19 12:35:53 Re: Parallel copy
Previous Message Masahiko Sawada 2020-10-19 12:20:09 Re: Transactions involving multiple postgres foreign servers, take 2