Re: ALTER OBJECT any_name SET SCHEMA name - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: ALTER OBJECT any_name SET SCHEMA name
Date
Msg-id m2zktnee5z.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Re: ALTER OBJECT any_name SET SCHEMA name  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: ALTER OBJECT any_name SET SCHEMA name
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> writes:
> You're mistaken, and this case definitely does need more thought.
> A schema owner is presumed to have the unconditional right to
> drop anything in his schema, whether he owns it or not.

Here a paste of how it works with current code.

dim=# create schema bob authorization bob;
CREATE SCHEMA

dim=# alter extension unaccent set schema bob;
ALTER EXTENSION

dim=# \c - bob
You are now connected to database "dim" as user "bob".

dim=> drop schema bob;
ERROR:  cannot drop schema bob because other objects depend on it
DETAIL:  extension unaccent depends on schema bob
HINT:  Use DROP ... CASCADE to drop the dependent objects too.

dim=> drop schema bob cascade;
NOTICE:  drop cascades to extension unaccent
DROP SCHEMA

dim=> \c - dim
You are now connected to database "dim" as user "dim".
dim=# select installed from pg_extensions where name = 'unaccent';installed 
-----------f
(1 row)

Isn't that enough for you?
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: temporary functions (and other object types)
Next
From: Marti Raudsepp
Date:
Subject: Re: [PATCH] Revert default wal_sync_method to fdatasync on Linux 2.6.33+