Re: oat_post_create expected behavior

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Mary Xu <yxu2162(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: oat_post_create expected behavior
Date: 2022-06-06 19:55:16
Message-ID: CA+TgmoYdhN_1S+evbCMY2V8darVey_-SFCvX9n_07yNVM5y_Bw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 6, 2022 at 3:46 PM Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
> On Mon, 2022-06-06 at 13:43 -0400, Robert Haas wrote:
> > Yeah, that comment could be made more clear.
>
> I still don't understand what the rule is.
>
> Is the rule that OAT_POST_CREATE must always use SnapshotSelf for any
> catalog access? And if so, do we need to update code in contrib
> extensions to follow that rule?

I don't think there is a rule in the sense that you want there to be
one. We sometimes call the object access hook before the CCI, and
sometimes after, and the sepgsql code knows which cases are handled
which ways and proceeds differently on that basis. If we went and
changed the sepgsql code that uses system catalog lookups to use
SnapshotSelf instead, I think it would still work, but it would be
less efficient, so that doesn't seem like a desirable change to me. If
it's possible to make the hook placement always happen after a CCI,
then we could change the sepgsql code to always use catalog lookups,
which would probably be more efficient but likely require adding some
CCI calls, which may attract objections from Tom --- or maybe it
won't. Absent either of those things, I'm inclined to just make the
comment clearly state that we're not consistent about it. That's not
great, but it may be the best we can do.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2022-06-06 20:39:17 Re: pgcon unconference / impact of block size on performance
Previous Message Jeff Davis 2022-06-06 19:46:25 Re: oat_post_create expected behavior