Re: Prevent internal error at concurrent CREATE OR REPLACE FUNCTION

From: Daniil Davydov <3danissimo(at)gmail(dot)com>
To: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>, Alexander Lakhin <exclusion(at)gmail(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>
Subject: Re: Prevent internal error at concurrent CREATE OR REPLACE FUNCTION
Date: 2025-10-01 13:30:38
Message-ID: CAJDiXgjXcLVwtH3qG4T8RtyBzpuiGHM0WizYf_iXWS70Jk8jwQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tue, Sep 30, 2025 at 9:02 AM Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp> wrote:
>
> I've attached rebase patches.
>

It seems redundant to me that in CatalogIndexInsert we first check the
unique constraint, and then pass the UNIQUE_CHECK_YES parameter
to the index_insert function call below. As far as I understand, after
check_unique_constraint we can be sure that everything is okay with
inserted values. Am I missing something?

Also, why should we add "IsCatalogRelation(heapRelation)" check inside
the CatalogIndexInsert function? We know for sure that a given table is a
catalog relation.

BTW, what do you think about adding an isolation test for a concurrent
"CREATE OR REPLACE FUNCTION" command? This is one of the
'problems' we're struggling with, but I don't see this case being explicitly
tested anywhere.

All other changes look good to me.

--
Best regards,
Daniil Davydov

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Laurenz Albe 2025-10-01 13:25:51 Re: JIT works only partially with meson build?