Re: Identifying user-created objects - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: Identifying user-created objects
Date
Msg-id CA+fd4k7S3ig5cbEX2gVonOChyrq3phxgey9RQJJnr2rPteBaZg@mail.gmail.com
Whole thread Raw
In response to Re: Identifying user-created objects  (Amit Langote <amitlangote09@gmail.com>)
Responses Re: Identifying user-created objects
List pgsql-hackers
On Mon, 10 Feb 2020 at 12:54, Amit Langote <amitlangote09@gmail.com> wrote:
>
> Sawada-san,
>
> On Mon, Feb 10, 2020 at 12:25 PM Masahiko Sawada
> <masahiko.sawada@2ndquadrant.com> wrote:
> > > > > On Thu, Feb 06, 2020 at 04:25:47PM +0900, Amit Langote wrote:
> > > > > > About the implementation, how about defining a static inline function,
> > > > > > say is_user_object(), next to FirstNormalObjectId's definition and
> > > > > > make pg_is_user_object() call it?  There are a few placed in the
> > > > > > backend code that perform the same computation as pg_is_user_object(),
> > > > > > which could be changed to use is_user_object() instead.
> >
> > Attached the updated version patch that includes regression tests. And
> > I have registered this to the next commit fest.
>
> Thank you.
>
> Any thoughts on the above suggestion?

Oops, I had overlooked it. I agree with you.

How about having it as a macro like:

#define ObjectIdIsUserObject(oid) ((Oid)(oid) >= FirstNormalObjectId)

Regards,

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



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: subplan resets wrong hashtable
Next
From: Amit Kapila
Date:
Subject: Re: typos in comments and user docs