Re: ALTER OBJECT any_name SET SCHEMA name

From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ALTER OBJECT any_name SET SCHEMA name
Date: 2010-11-05 16:16:37
Message-ID: m2mxpnhhju.fsf@2ndQuadrant.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Frankly, the get_extension_namespace bit still feels wrong to me. I
> would have the namespace be present in the pg_extension catalog, even if
> it's not part of the primary key. This would let you answer the
> question: what schema did I install this extension in? (and display it
> in \dx commands etc)

dim=# \dx
List of extensions
Schema | Name | Version | Description
--------+--------------------+----------+--------------
utils | lo | 9.1devel | managing Larg
utils | unaccent | 9.1devel | text search d
utils | adminpack | 9.1devel | Administrativ
utils | moddatetime | 9.1devel | functions for
utils | isn | 9.1devel | data types fo
...

I've cut in there obviously, but you get the idea.

> If you don't know that, then the ability to change
> it to another schema looks incomplete. Since we're now saying that
> moving the extension to another schema is a first-class operation, I
> think the data should be represented more explicitely in the catalog
> rather than being derived from pg_depend contents.

Well, I'm thinking that:

- namespace columns in the catalogs are actually all for objects that
live in a schema and extension do not

- pg_depend is a good source here, as it is for get_constraint_index
and some other functions

- maybe the problem is that parts of this patch should go into the main
extension's one, where there's already the with schema foo feature,
rather than be introduced in the alter extension set schema patch?

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Farina 2010-11-05 16:31:19 Re: ALTER TABLE ... IF EXISTS feature?
Previous Message Alexander Korotkov 2010-11-05 16:15:55 Re: Fix for seg picksplit function