Re: [HACKERS] Bug? Concurrent COMMENT ON and DROP object

2010-07-09 Thread Robert Haas
2010/7/9 KaiGai Kohei : > (2010/07/07 11:31), Robert Haas wrote: >> On Tue, Jul 6, 2010 at 10:18 PM, Tom Lane  wrote: >>> Robert Haas  writes: Obviously not.  We don't need to acquire an AccessExclusiveLock to comment on an object - just something that will CONFLICT WITH an AccessExc

Re: [HACKERS] Bug? Concurrent COMMENT ON and DROP object

2010-07-08 Thread KaiGai Kohei
(2010/07/07 11:31), Robert Haas wrote: > On Tue, Jul 6, 2010 at 10:18 PM, Tom Lane wrote: >> Robert Haas writes: >>> Obviously not. We don't need to acquire an AccessExclusiveLock to >>> comment on an object - just something that will CONFLICT WITH an >>> AccessExclusiveLock. So, use the same l

Re: [HACKERS] Bug? Concurrent COMMENT ON and DROP object

2010-07-07 Thread Tom Lane
Robert Haas writes: > On Tue, Jul 6, 2010 at 10:59 PM, Alvaro Herrera > wrote: >> Excerpts from Robert Haas's message of mar jul 06 22:31:40 -0400 2010: >>> Hmm... so, maybe ShareUpdateExclusiveLock? >> >> So COMMENT ON will conflict with (auto)vacuum?  Seems a bit weird ... > Well, I'm open to

Re: [HACKERS] Bug? Concurrent COMMENT ON and DROP object

2010-07-07 Thread Robert Haas
On Tue, Jul 6, 2010 at 10:59 PM, Alvaro Herrera wrote: > Excerpts from Robert Haas's message of mar jul 06 22:31:40 -0400 2010: >> On Tue, Jul 6, 2010 at 10:18 PM, Tom Lane wrote: >> > Robert Haas writes: >> >> Obviously not.  We don't need to acquire an AccessExclusiveLock to >> >> comment on a

Re: [HACKERS] Bug? Concurrent COMMENT ON and DROP object

2010-07-06 Thread Alvaro Herrera
Excerpts from Robert Haas's message of mar jul 06 22:31:40 -0400 2010: > On Tue, Jul 6, 2010 at 10:18 PM, Tom Lane wrote: > > Robert Haas writes: > >> Obviously not.  We don't need to acquire an AccessExclusiveLock to > >> comment on an object - just something that will CONFLICT WITH an > >> Acce

Re: [HACKERS] Bug? Concurrent COMMENT ON and DROP object

2010-07-06 Thread Robert Haas
On Tue, Jul 6, 2010 at 10:18 PM, Tom Lane wrote: > Robert Haas writes: >> Obviously not.  We don't need to acquire an AccessExclusiveLock to >> comment on an object - just something that will CONFLICT WITH an >> AccessExclusiveLock.  So, use the same locking rules, perhaps, but >> take a much wea

Re: [HACKERS] Bug? Concurrent COMMENT ON and DROP object

2010-07-06 Thread Tom Lane
Robert Haas writes: > Obviously not. We don't need to acquire an AccessExclusiveLock to > comment on an object - just something that will CONFLICT WITH an > AccessExclusiveLock. So, use the same locking rules, perhaps, but > take a much weaker lock, like AccessShareLock. Well, it probably needs

Re: [HACKERS] Bug? Concurrent COMMENT ON and DROP object

2010-07-06 Thread Robert Haas
2010/7/6 KaiGai Kohei : > (2010/07/06 23:33), Tom Lane wrote: >> Robert Haas  writes: >>> 2010/7/6 KaiGai Kohei: In the following scenario, we can see orphan comments. >> >>> Yeah.  I think the reason we haven't seen any complaints about this >>> before is that the worst-case scenario is that

Re: [HACKERS] Bug? Concurrent COMMENT ON and DROP object

2010-07-06 Thread KaiGai Kohei
(2010/07/06 23:33), Tom Lane wrote: > Robert Haas writes: >> 2010/7/6 KaiGai Kohei: >>> In the following scenario, we can see orphan comments. > >> Yeah. I think the reason we haven't seen any complaints about this >> before is that the worst-case scenario is that a comment for a dropped >> data

Re: [HACKERS] Bug? Concurrent COMMENT ON and DROP object

2010-07-06 Thread Tom Lane
Robert Haas writes: > 2010/7/6 KaiGai Kohei : >> In the following scenario, we can see orphan comments. > Yeah. I think the reason we haven't seen any complaints about this > before is that the worst-case scenario is that a comment for a dropped > database object eventually becomes associated wi

Re: [HACKERS] Bug? Concurrent COMMENT ON and DROP object

2010-07-06 Thread Robert Haas
2010/7/6 KaiGai Kohei : > In the following scenario, we can see orphan comments. Yeah. I think the reason we haven't seen any complaints about this before is that the worst-case scenario is that a comment for a dropped database object eventually becomes associated with a new database object. But

[HACKERS] Bug? Concurrent COMMENT ON and DROP object

2010-07-06 Thread KaiGai Kohei
In the following scenario, we can see orphan comments. session.1 session.2 ---- 1: CREATE TYPE my_typ AS (a int, b text); 2: BEGIN; 3: COMMENT ON TYPE my_typ IS 'testt