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

From: Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PgHacker <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [v9.2] DROP Reworks Part.0 - 'missing_ok' support of get_object_address
Date: 2011-06-27 20:40:06
Message-ID: BANLkTikuvXBj6vrgt-hrujCSY+TRoBmNuw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 an
index to be removed
in the case when OBJECT_INDEX is supplied.
However, the revised get_object_address() opens the supplied relation
(= index) in same
time with lookup of its name. So, we may break down the
relation_openrv_extended()
into a pair of RangeVarGetRelid() and relation_open().

Any good idea?

2011/6/27 Robert Haas <robertmhaas(at)gmail(dot)com>:
> On Mon, Jun 27, 2011 at 2:59 PM, Noah Misch <noah(at)leadboat(dot)com> 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 <robertmhaas(at)gmail(dot)com> 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 there's no forseeable need to
>>> > add anything other than missing_ok, my gut is to just add it and call
>>> > it good.
>>>
>>> On further review, my gut is having second thoughts.  This patch is an
>>> awful lot smaller and easier to verify correctness if I just mess with
>>> the "try" calls and not the regular ones; and it avoids both
>>> back-patching hazards for us and hoops for third-party loadable
>>> modules that are using the non-try versions of those functions to jump
>>> through.
>>
>> +1.  (Note that the function header comments need a few more updates.)
>
> Oh, good catch, thanks.  Committed with some further comment changes.
>
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

--
KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>

Attachment Content-Type Size
pgsql-v9.2-drop-reworks-part-0.v5.patch application/octet-stream 20.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gabriele Bartolini 2011-06-27 21:33:54 Dry Run mode for pg_archivecleanup
Previous Message David E. Wheeler 2011-06-27 20:19:05 Re: generate_series() Interpretation