Re: [HACKERS] [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address

2011-06-27 Thread Robert Haas
On Mon, Jun 27, 2011 at 4:40 PM, Kohei KaiGai wrote: > The attached patch is rebased one towards the latest tree, using > relation_openrv_extended(). Committed. > Although it is not a matter in this patch itself, I found a problem on > the upcoming patch > that consolidate routines associated wi

Re: [HACKERS] [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address

2011-06-27 Thread Kohei KaiGai
The attached patch is rebased one towards the latest tree, using relation_openrv_extended(). Although it is not a matter in this patch itself, I found a problem on the upcoming patch that consolidate routines associated with DropStmt. Existing RemoveRelations() acquires a lock on the table owning

Re: [HACKERS] [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address

2011-06-27 Thread Robert Haas
On Mon, Jun 27, 2011 at 2:59 PM, Noah Misch wrote: > On Mon, Jun 27, 2011 at 01:28:30PM -0400, Robert Haas wrote: >> On Wed, Jun 22, 2011 at 1:36 PM, Robert Haas wrote: >> > I agree with you. ?If we had a whole pile of options it might be worth >> > having heap_openrv() and heap_openrv_extended()

Re: [HACKERS] [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address

2011-06-27 Thread Noah Misch
On Mon, Jun 27, 2011 at 01:28:30PM -0400, Robert Haas wrote: > On Wed, Jun 22, 2011 at 1:36 PM, Robert Haas wrote: > > I agree with you. ?If we had a whole pile of options it might be worth > > having heap_openrv() and heap_openrv_extended() so as not to > > complicate the simple case, but since t

Re: [HACKERS] [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address

2011-06-27 Thread Robert Haas
On Wed, Jun 22, 2011 at 1:36 PM, Robert Haas wrote: > On Wed, Jun 22, 2011 at 12:51 PM, Alvaro Herrera > wrote: >> Excerpts from Robert Haas's message of mié jun 22 08:56:02 -0400 2011: >> >>> Another option might be to leave heap_openrv() and relation_openrv() >>> alone and add a missing_ok argu

Re: [HACKERS] [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address

2011-06-23 Thread Kohei KaiGai
I revised my patch based on your "there-is-no-try-v2.patch". It enabled to implement 'missing_ok' support without modification of orders to solve the object name and relation locking. Thanks, 2011/6/22 Robert Haas : > On Wed, Jun 22, 2011 at 12:51 PM, Alvaro Herrera > wrote: >> Excerpts from Rob

Re: [HACKERS] [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address

2011-06-22 Thread Robert Haas
On Wed, Jun 22, 2011 at 12:51 PM, Alvaro Herrera wrote: > Excerpts from Robert Haas's message of mié jun 22 08:56:02 -0400 2011: > >> Another option might be to leave heap_openrv() and relation_openrv() >> alone and add a missing_ok argument to try_heap_openrv() and >> try_relation_openrv().  Pass

Re: [HACKERS] [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address

2011-06-22 Thread Alvaro Herrera
Excerpts from Robert Haas's message of mié jun 22 08:56:02 -0400 2011: > Another option might be to leave heap_openrv() and relation_openrv() > alone and add a missing_ok argument to try_heap_openrv() and > try_relation_openrv(). Passing true would give the same behavior as > presently; passing f

Re: [HACKERS] [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address

2011-06-22 Thread Tom Lane
Robert Haas writes: > Another option might be to leave heap_openrv() and relation_openrv() > alone and add a missing_ok argument to try_heap_openrv() and > try_relation_openrv(). +1 for that, although the try_ prefix might be inappropriate naming now; how about cond_relation_openrv?

Re: [HACKERS] [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address

2011-06-22 Thread Robert Haas
On Wed, Jun 22, 2011 at 6:18 AM, Noah Misch wrote: > On Tue, Jun 21, 2011 at 11:11:41PM -0400, Robert Haas wrote: >> On Tue, Jun 21, 2011 at 11:04 PM, Tom Lane wrote: >> > Robert Haas writes: >> >> Some of the refactoring you've done here seems likely to break things, >> >> because you're basica

Re: [HACKERS] [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address

2011-06-21 Thread Robert Haas
On Tue, Jun 21, 2011 at 11:04 PM, Tom Lane wrote: > Robert Haas writes: >> Some of the refactoring you've done here seems likely to break things, >> because you're basically making the relation locking happen later than >> it does not, and that's going to cause problems. >> get_object_address_rel

Re: [HACKERS] [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address

2011-06-21 Thread Tom Lane
Robert Haas writes: > Some of the refactoring you've done here seems likely to break things, > because you're basically making the relation locking happen later than > it does not, and that's going to cause problems. > get_object_address_relobject() is a particularly egregious > rearrangement. It

Re: [HACKERS] [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address

2011-06-21 Thread Robert Haas
On Sun, Jun 19, 2011 at 7:40 AM, Kohei KaiGai wrote: > Sorry, the previous revision did not update regression test part > towards the latest one. Some of the refactoring you've done here seems likely to break things, because you're basically making the relation locking happen later than it does n

Re: [HACKERS] [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address

2011-06-19 Thread Kohei KaiGai
Sorry, the previous revision did not update regression test part towards the latest one. 2011/6/19 Kohei KaiGai : > Thanks for your review. > > 2011/6/19 Robert Haas : >> On Tue, Jun 14, 2011 at 8:06 AM, Kohei KaiGai wrote: >>> The attached patch is a preparation to rework implementation of DROP

Re: [HACKERS] [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address

2011-06-19 Thread Kohei KaiGai
Thanks for your review. 2011/6/19 Robert Haas : > On Tue, Jun 14, 2011 at 8:06 AM, Kohei KaiGai wrote: >> The attached patch is a preparation to rework implementation of DROP >> statement >> using a common code. That intends to apply get_object_address() to resolve >> name >> of objects to be r

Re: [HACKERS] [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address

2011-06-18 Thread Robert Haas
On Tue, Jun 14, 2011 at 8:06 AM, Kohei KaiGai wrote: > The attached patch is a preparation to rework implementation of DROP statement > using a common code. That intends to apply get_object_address() to resolve > name > of objects to be removed, and eventually minimizes the number of places to pu

[HACKERS] [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address

2011-06-14 Thread Kohei KaiGai
The attached patch is a preparation to rework implementation of DROP statement using a common code. That intends to apply get_object_address() to resolve name of objects to be removed, and eventually minimizes the number of places to put permission checks. Its first step is an enhancement of get_o