Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TzusI-0001zB-0X for pgsql-bugs@arkaria.postgresql.org; Mon, 28 Jan 2013 20:00:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TzusG-0007g0-Tk for pgsql-bugs@arkaria.postgresql.org; Mon, 28 Jan 2013 20:00:12 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TzusF-0007fs-VV for pgsql-bugs@postgresql.org; Mon, 28 Jan 2013 20:00:12 +0000 Received: from smtprelay0208.b.hostedemail.com ([64.98.42.208] helo=smtprelay.b.hostedemail.com) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TzusE-0001vg-Dy for pgsql-bugs@postgresql.org; Mon, 28 Jan 2013 20:00:11 +0000 Received: from filter.hostedemail.com (b-bigip1 [10.5.19.254]) by smtprelay06.b.hostedemail.com (Postfix) with SMTP id 2CC686444F; Mon, 28 Jan 2013 20:00:09 +0000 (UTC) X-Panda: scanned! X-Spam-Summary: 50, 0, 0, , d41d8cd98f00b204, alvherre@alvh.no-ip.org, :::::::::, RULES_HIT:355:379:599:601:800:945:960:967:973:988:989:1260:1277:1311:1312:1313:1314:1345:1359:1431:1437:1515:1516:1518:1519:1534:1542:1593:1594:1595:1596:1711:1730:1747:1777:1792:2194:2199:2393:2525:2540:2560:2563:2682:2685:2693:2828:2840:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3027:3138:3139:3140:3141:3142:3354:3865:3866:3867:3868:3869:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4605:4659:5007:6261:7679:7809:7903:8957:9025:9121:10004:10394:10400:10471:10848:11256:11257:11658:11914:12517:12519, 0, RBL:none, CacheIP:none, Bayesian:0.5, 0.5, 0.5, Netcheck:none, DomainCache:0, MSF:not bulk, SPF:fn, MSBL:0, DNSBL:none, Custom_rules:0:0:0 X-Session-Marker: 616C76686572726540616C76682E6E6F2D69702E6F7267 X-Filterd-Recvd-Size: 3544 Received: from perhan.alvh.no-ip.org (unknown [190.95.28.201]) (Authenticated sender: alvherre@alvh.no-ip.org) by omf09.b.hostedemail.com (Postfix) with ESMTPA; Mon, 28 Jan 2013 20:00:08 +0000 (UTC) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 208FE6E0B6; Mon, 28 Jan 2013 17:00:06 -0300 (CLST) Date: Mon, 28 Jan 2013 17:00:06 -0300 From: Alvaro Herrera To: Tom Lane Cc: Jeff Janes , "spam_eater@gmx.net" , "pgsql-bugs@postgresql.org" , Jaime Casanova Subject: Re: Re: BUG #7748: "drop owned by" fails with error message: "unrecognized object class: 1262" Message-ID: <20130128200005.GB4050@alvh.no-ip.org> References: <11629.1355071394@sss.pgh.pa.us> <20121210041307.GA13156@alvh.no-ip.org> <20130125195716.GI5584@alvh.no-ip.org> <29842.1359162545@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <29842.1359162545@sss.pgh.pa.us> User-Agent: Mutt/1.5.21 (2010-09-15) Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: 0.3 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Tom Lane escribi=F3: > Alvaro Herrera writes: > > I disagree with this assessment, and propose the attached patch instead. >=20 > +1 for this approach in HEAD ... >=20 > > This is the patch for the master branch; I have not tried to backpatch > > it yet. Conflicts are expected due to the refactoring of ALTER commands > > by KaiGai. >=20 > ... but I'm worried that you'd need a substantially larger patch in back > branches, and accordingly I'm not sure this is what to do in the back > branches. Without that refactoring, you might need to duplicate more > code, so it might be safer to just revert as Jeff suggested. I had a look at what it'd take to backpatch. For REASSIGN OWNED, you're right that it'd require some refactoring, and it's probably not worthwhile (the code is not really all that complicated). However, for DROP OWNED the proposed hunks apply fine. Only 8.3 needs a different patch, but it's only because whitespace is different. So what we would end up with, is that DROP OWNED works for shared objects (i.e. grants on tablespaces and databases are revoked), but REASSIGN OWNED does not; so you're forced to do ALTER DATABASE/TABLESPACE SET OWNER. Since it's the grants that are more likely to cause headaches than ownership when trying to drop users, I suggest that applying those patches is the most convenient. (We know that this is a real problem because of the bug reports we've gotten.) > The documentation also needs more work than what you suggest in your > followup. The command reference pages should explicitly say that they > operate on both objects in the current database and shared objects. > Explicitly defining shared objects as databases and tablespaces > wouldn't hurt any. >=20 > It also strikes me that where you suggest "Because REASSIGN OWNED does > not affect objects in other databases ...", it might be clearer to say > "Because REASSIGN OWNED does not affect objects within other databases > ...", which makes the idea of containment a little stronger. Okay, I will revise those proposed docs changes. --=20 =C1lvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs