Re: [HACKERS] Insufficient locking for ALTER DEFAULT PRIVILEGES

2015-06-23 Thread Robert Haas
On Sun, Jun 21, 2015 at 11:11 AM, Andres Freund wrote: > On 2015-06-21 11:45:24 -0300, Alvaro Herrera wrote: >> Alvaro Herrera wrote: >> > Now that I actually check with a non-relation object, I see pretty much >> > the same error. So probably if instead of some narrow bug fix what we >> > need i

Re: [HACKERS] Insufficient locking for ALTER DEFAULT PRIVILEGES

2015-06-21 Thread Amit Kapila
On Sat, Jun 20, 2015 at 10:57 PM, Alvaro Herrera wrote: > > Vik Fearing wrote: > > > Session 1: > > begin; > > alter default privileges in schema bug grant all on tables to postgres; > > > > Session 2: > > alter default privileges in schema bug grant all on tables to postgres; > > > > > > Session

Re: [HACKERS] Insufficient locking for ALTER DEFAULT PRIVILEGES

2015-06-21 Thread Andres Freund
On 2015-06-21 11:45:24 -0300, Alvaro Herrera wrote: > Alvaro Herrera wrote: > > > Now that I actually check with a non-relation object, I see pretty much > > the same error. So probably if instead of some narrow bug fix what we > > need is some general solution for all object types. I know this

Re: [HACKERS] Insufficient locking for ALTER DEFAULT PRIVILEGES

2015-06-21 Thread Alvaro Herrera
Alvaro Herrera wrote: > Now that I actually check with a non-relation object, I see pretty much > the same error. So probably if instead of some narrow bug fix what we > need is some general solution for all object types. I know this has > been discussed a number of times ... Anyway I see now t

Re: [HACKERS] Insufficient locking for ALTER DEFAULT PRIVILEGES

2015-06-20 Thread Alvaro Herrera
Alvaro Herrera wrote: > So it turns out we don't have any locking here at all. I don't believe > we have it for all object types, but in most cases it's not as obnoxious > as this one. But at least for relations we have some nice coding in > RangeVarGetRelidExtended and RangeVarGetAndCheckCreati

Re: [HACKERS] Insufficient locking for ALTER DEFAULT PRIVILEGES

2015-06-20 Thread Alvaro Herrera
Vik Fearing wrote: > Session 1: > begin; > alter default privileges in schema bug grant all on tables to postgres; > > Session 2: > alter default privileges in schema bug grant all on tables to postgres; > > > Session 1: > commit; > > Session 2: > ERROR: tuple concurrently updated So it turn

[HACKERS] Insufficient locking for ALTER DEFAULT PRIVILEGES

2015-06-19 Thread Vik Fearing
I came across the following bug this week: Session 0: begin; create schema bug; alter default privileges in schema bug grant all on tables to postgres; commit; Session 1: begin; alter default privileges in schema bug grant all on tables to postgres; Session 2: alter default privileges in schema