Re: Dumping an Extension's Script

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Dumping an Extension's Script
Date: 2012-12-05 18:13:19
Message-ID: 20121205181319.GF27424@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2012-12-05 12:55:42 -0500, Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > On 2012-12-05 19:13:10 +0200, Heikki Linnakangas wrote:
> >> And I still don't understand why pg_dump needs to know about any of this...
>
> > Extensions should be fully per-database and we want pg_dump backups to
> > be restorable into another database/clusters/servers.
>
> Wait a minute. I haven't bought into either of those statements, and
> most particularly not the first one.

Ok.

> Upthread, Dimitri claimed that he wasn't creating two different kinds of
> extensions with this patch, but the more I read about it the more it
> seems that he *is* making a fundamentally different kind of animal.
> And I don't think it's necessarily a good idea, especially not if we
> still call it an extension.

I have to admit I haven't read the whole discussion about this. And I
also have to say that I have no idea yet whether I like the current
implementation because I haven't looked at it yet. I just wanted to give
input to the separate problems Heikki listed. Because I wished for
something roughly like this for years...

To me it seems to be sensible that extensions which are preinstalled on
the system are global and extensions which a single user inside a single
database created are per database.
Imo that doesn't make them all that fundamentally different.

> I kind of like Heikki's idea of leaving CREATE EXTENSION alone and
> inventing a separate "UPLOAD EXTENSION" operation, but there's a problem
> with that: in many, probably most, installations, the server does not
> and should not have permission to scribble on the directories where the
> extension scripts are stored. Possibly we could circumvent that by
> creating an auxiliary extensions directory under $PGDATA. (But then
> it starts to seem like pg_dumpall --- not pg_dump --- ought to include
> those files in its output...)

UPLOAD EXTENSION seems to be a good idea.

But I really really would like them to go to a per-database directory
not a per-cluster one. Otherwise the coordination between different
database "owners" inside a cluster will get really hairy. I want to be
able to install different versions of an application into different
databases.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2012-12-05 18:15:42 Re: Dumping an Extension's Script
Previous Message Tom Lane 2012-12-05 18:11:51 Re: ALTER TABLE ... NOREWRITE option