Re: erroneous restore into pg_catalog schema

From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Marko Kreen <markokr(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Erik Rijkers <er(at)xs4all(dot)nl>, "pgsql-hackers\(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>
Subject: Re: erroneous restore into pg_catalog schema
Date: 2013-05-14 07:29:38
Message-ID: m2ppwuvx25.fsf@2ndQuadrant.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Stephen Frost <sfrost(at)snowman(dot)net> writes:
> * Marko Kreen (markokr(at)gmail(dot)com) wrote:
>> On Sat, May 04, 2013 at 10:57:44PM +0200, Dimitri Fontaine wrote:
>> > Other than adminpack, I know of PGQ installing their objects in
>> > pg_catalog. They only began doing that when switching to the CREATE
>> > EXTENSION facility. And they set relocatable to false.
>>
>> FYI - PgQ and related modules install no objects into pg_catalog.
>>
>> I used schema='pg_catalog' because I had trouble getting schema='pgq'
>> to work. I wanted 'pgq' schema to live and die with extension,
>> and that was only way I got it to work on 9.1.

Sorry, I didn't take the time to actually read \dx+ pgq, just remembered
(and checked) that the control file did mention pg_catalog.

There is a documented way to have the schema live and die with the
extension), which is:

relocatable = false
schema = 'pgq'

Then CREATE EXTENSION will also create the schema, that will be a member
of the extension, and thus will get DROPed with it.

> I've read through this thread and I think you're the only person here
> that I actually agree with.. I like the idea of having a schema that
> lives & dies with an extension. imv, putting random objects (of ANY
> kind) into pg_catalog is a bad idea. Sure, it's convenient because it's
> always in your search_path, but that, imv, means we should have a way to
> say "these schemas are always in the search_path", not that we should
> encourage people to dump crap into pg_catalog.

I'm not sure I agree with that view about pg_catalog. Sometimes we talk
about moving some parts of core in pre-installed extensions instead, and
if we do that we will want those extensions to install themselves into
pg_catalog.

Maybe we need some vocabulary to be able to distinguish "system
extensions" from "user extensions", while keeping in mind that the goal
is for those two beasts to remain the same thing at the SQL level (try
reading the "Inline Extension" or "Extension Templates" threads if
you're not convinced, I got there the hard way).

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 Hannu Krosing 2013-05-14 07:50:50 Re: [HACKERS] Slicing TOAST
Previous Message Simon Riggs 2013-05-14 07:05:03 Slicing TOAST