Re: Concurrent CREATE TABLE/DROP SCHEMA leaves inconsistent leftovers - Mailing list pgsql-hackers

From Nikhil Sontakke
Subject Re: Concurrent CREATE TABLE/DROP SCHEMA leaves inconsistent leftovers
Date
Msg-id CANgU5Zcyvt_Zx_MHt9V4va3JMqciBa6yQGE_R4JffdyBWBp1LQ@mail.gmail.com
Whole thread Raw
In response to Re: Concurrent CREATE TABLE/DROP SCHEMA leaves inconsistent leftovers  (Nikhil Sontakke <nikhil.sontakke@enterprisedb.com>)
Responses Re: Concurrent CREATE TABLE/DROP SCHEMA leaves inconsistent leftovers
Re: Concurrent CREATE TABLE/DROP SCHEMA leaves inconsistent leftovers
List pgsql-hackers
Hi,
 
Ok, understood.


PFA, a patch against git head. We take the AccessShareLock lock on the schema in DefineRelation now. Note that we do not want to interlock with other concurrent creations in the schema. We only want to interlock with deletion activity. So even performance wise this should not be much of an overhead in case of concurrent DDL operations to the same schema.

Adding this in DefineRelation handles creation of tables/views/types/sequences. I do not think we need to do stuff in ALTER commands, because the objects pre-exist and this issue appears to be with new objects only.

Comments?

Regards,
Nikhils
Attachment

pgsql-hackers by date:

Previous
From: Jan Kundrát
Date:
Subject: Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message
Next
From: Robert Haas
Date:
Subject: Re: Re: [patch] Include detailed information about a row failing a CHECK constraint into the error message