Re: Identifying user-created objects

From: Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Amit Langote <amitlangote09(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Identifying user-created objects
Date: 2020-02-10 05:22:54
Message-ID: CA+fd4k5EUam3e04zTxiba-XQwL3OV0jYn-pr=2P_kXXDFszbmA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 10 Feb 2020 at 14:09, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Mon, Feb 10, 2020 at 01:16:30PM +0900, Amit Langote wrote:
> > On Mon, Feb 10, 2020 at 1:06 PM Masahiko Sawada
> > <masahiko(dot)sawada(at)2ndquadrant(dot)com> wrote:
> >> How about having it as a macro like:
> >>
> >> #define ObjectIdIsUserObject(oid) ((Oid)(oid) >= FirstNormalObjectId)
> >
> > I'm fine with a macro.
>
> I am not sure that it is worth having one extra abstraction layer for
> that.

Hmm I'm not going to insist on that but I thought that it could
somewhat improve readability at places where they already compares an
oid to FirstNormalObjectId as Amit mentioned:

src/backend/catalog/pg_publication.c: relid >= FirstNormalObjectId;
src/backend/utils/adt/json.c: if (typoid >= FirstNormalObjectId)
src/backend/utils/adt/jsonb.c: if (typoid >= FirstNormalObjectId)

Regards,

--
Masahiko Sawada http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kuntal Ghosh 2020-02-10 05:30:26 Re: logical decoding : exceeded maxAllocatedDescs for .spill files
Previous Message Amit Langote 2020-02-10 05:10:24 Re: In PG12, query with float calculations is slower than PG11