oat_post_create expected behavior

From: Mary Xu <yxu2162(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: oat_post_create expected behavior
Date: 2022-06-02 22:37:01
Message-ID: CAHoZxqvN2eoic_CvjsAvpryyLyA2xG8JmsyMtKFFJz_1oFhfOg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

I was using an object access hook for oat_post_create access while creating
an extension and expected that I would be able to query for the newly
created extension with get_extension_oid(), but it was returning
InvalidOid. However, the same process works for triggers, so I was
wondering what the expected behavior is?
From the documentation in objectaccess.h, it doesn't mention anything about
CommandCounterIncrement() for POST_CREATE which implied to me that it
wasn't something I would need to worry about.
One option I thought of was this patch where CCI is called before the
access hook so that the new tuple is visible in the hook. Another option
would be to revise the documentation to reflect the expected behavior.

Thanks,

Mary Xu

Attachment Content-Type Size
postcreate_bugfix.patch application/x-patch 6.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2022-06-02 22:56:28 Re: [PATCH] Expose port->authn_id to extensions and triggers
Previous Message Jacob Champion 2022-06-02 22:21:26 Re: [PATCH] Compression dictionaries for JSONB