Re: Prevent internal error at concurrent CREATE OR REPLACE FUNCTION
От | Yugo Nagata |
---|---|
Тема | Re: Prevent internal error at concurrent CREATE OR REPLACE FUNCTION |
Дата | |
Msg-id | 20250527175240.14375b86fca1cea40d1b0961@sraoss.co.jp обсуждение исходный текст |
Ответ на | Re: Prevent internal error at concurrent CREATE OR REPLACE FUNCTION (Jim Jones <jim.jones@uni-muenster.de>) |
Список | pgsql-hackers |
On Tue, 27 May 2025 08:33:42 +0200 Jim Jones <jim.jones@uni-muenster.de> wrote: > Hi Yugo > > On 26.05.25 18:39, Yugo Nagata wrote: > > I can see the error when two concurrent transactions issue > > "alter function f() immutable". > > > I might have missed something in my last tests... I could now reproduce > the behaviour you mentioned. > > I've tested v2 and it works as described. CREATE OR REPLACE FUNCTION and > ALTER TABLE no longer raise an error after the lock by the concurrent > transaction was freed. > > One quick question in v2-002: > > tup = SearchSysCacheCopy1(PROCOID, ObjectIdGetDatum(funcOid)); > - if (!HeapTupleIsValid(tup)) /* should not happen */ > - elog(ERROR, "cache lookup failed for function %u", funcOid); > + if (!HeapTupleIsValid(tup)) > + ereport(ERROR, > + errcode(ERRCODE_UNDEFINED_OBJECT), > + errmsg("function \"%s\" does not exist", > + NameListToString(stmt->func->objname))); > > > Is it really ok to change this error message here? Did the addition of > LockDatabaseObject change the semantics of the previous message? Yes. AcceptInvalidationMessages() is called in LockDatabaseObject() after wait, and this enables the detection of object deletion during the wait. Regards, Yugo Nagata -- Yugo Nagata <nagata@sraoss.co.jp>
В списке pgsql-hackers по дате отправления: