Re: RangeVarGetRelid()

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: RangeVarGetRelid()
Date: 2011-11-17 21:12:54
Message-ID: 1321564357-sup-3776@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Excerpts from Robert Haas's message of jue nov 17 17:51:06 -0300 2011:

> The trouble is, I'm not quite sure how to do that. It seems like
> permissions checks and lock-the-heap-for-this-index should be done in
> RangeVarGetRelid() just after the block that says "if (retry)" and
> just before the block that calls LockRelationOid(). That way, if we
> end up deciding we need to retry the name lookup, we'll retry all that
> other stuff as well, which is exactly right. The difficulty is that
> different callers have different needs for what should go in that
> space, to the degree that I'm a bit nervous about continuing to add
> arguments to that function to satisfy what everybody needs. Maybe we
> could make most of them Booleans and pass an "int flags" argument.
> Another option would be to add a "callback" argument to that function
> that would be called at that point with the relation, relId, and
> oldRelId as arguments. Alternatively, we could just resign ourselves
> to duplicating the loop in this function into each place in the code
> that has a special-purpose requirement, but the function is complex
> enough to make that a pretty unappealing prospect.

I'm for the callback.

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2011-11-17 21:26:09 Re: Refactoring on DROP/ALTER SET SCHEMA/ALTER RENAME TO statement
Previous Message Robert Haas 2011-11-17 20:51:06 RangeVarGetRelid()