Skip site navigation (1) Skip section navigation (2)

Re: REASSIGN OWNED lacks support for FDWs

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: REASSIGN OWNED lacks support for FDWs
Date: 2012-02-21 18:54:03
Message-ID: 1329850393-sup-6835@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-hackers
Excerpts from Tom Lane's message of lun feb 20 12:37:45 -0300 2012:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> > On Wed, Feb 15, 2012 at 12:58 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >> As per http://archives.postgresql.org/pgsql-general/2012-02/msg00304.php
> >> there is no switch case in shdepReassignOwned for foreign data wrappers.
> >> 
> >> The obvious short-term answer (and probably the only back-patchable one)
> >> is to add a case for that object type. But after all the refactoring
> >> that's been done in the general area of this type of command, I'm a bit
> >> surprised that shdepReassignOwned still looks like this. Can't we merge
> >> this knowledge into someplace where it doesn't have to be maintained
> >> separately?
> 
> > Hmm.  I guess we could add function pointers to the ObjectProperty
> > array in objectaddress.c.  Then we could just search the array for the
> > catalog ID and call the associated function through the function
> > pointer, rather than having a switch in shdepReassignOwned().  Since
> > anyone adding a new object type ought to be looking at objectaddress.c
> > anyway, that would be one less place for people to forget to update.
> 
> I was wondering more whether there isn't some single entry point that
> would allow access to ALTER OWNER functionality for any object type.
> If we still are in a situation where new shdepReassignOwned-specific
> code has to be written for every object type, it's not really much
> better.
> 
> BTW, code freeze for the upcoming releases is Thursday ... is anyone
> going to actually fix this bug before then?  I'm unlikely to find
> the time myself.

I'm gonna take a stab at fixing this now (the simple way).

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

In response to

Responses

pgsql-hackers by date

Next:From: David E. WheelerDate: 2012-02-21 19:50:18
Subject: Document hashtext() and Friends?
Previous:From: Peter GeogheganDate: 2012-02-21 18:45:15
Subject: Re: [PATCH] Support for foreign keys with arrays

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group