Re: Extension Templates S03E11

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Boszormenyi Zoltan <zb(at)cybertec(dot)at>, Thom Brown <thom(at)linux(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Extension Templates S03E11
Date: 2013-12-03 08:08:03
Message-ID: 529D9163.5080508@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12/03/2013 09:25 AM, Jeff Davis wrote:
> On Mon, 2013-12-02 at 11:07 +0200, Heikki Linnakangas wrote:
>> There should be no difference between file-based extensions and
>> catalog-based extensions. It's just two different ways to install the
>> same extension. The extension author doesn't need to care about that,
>> it's the DBA that decides which method to use to install it.
>>
>> I'm going to object loudly to any proposal that doesn't meet that criteria.
>
> But we're arguably already in this position today. For a SQL-only
> extension, the author can choose between:
>
> 1. Using a schema/namespace
> a. installable over libpq
> b. installable by non-superusers
> c. no special handling when it comes to administration
>
> 2. Using an extension
> a. convenient metadata (e.g. "requires")
> b. upgrade scripts
> c. omitted from pg_dump so can be managed separately
> d. relocatable
> e. not tied to one schema
>
> And if the author decides to change, it requires porting the extension
> to the other form.
>
> Note: I'm using "extension" loosely here. We might call the SQL-only,
> user-installable variety something else.

Good point. It's not too hard to install an "extension" written as an
extension as plain schema objects, though. You can just run the .sql
script through psql. That's what you used to do before extensions were
invented. (the scripts in contrib contain an explicit check against
that, but I don't think that's common outside contrib)

Another perspective is that that's already a situation we'd rather not
have. Let's not make it worse by introducing a third way to install an
extension, which again requires the extension author to package the
extension differently.

> So how do we get to the point where we have clear advice to the author
> of a SQL-only extension? And how do we do that without asking them to
> port anything?

Yeah, that's the crucial question of this whole thread.

> Stephen mentioned using external tools and/or metadata, but to me that
> sounds like it would require porting the extension away from what's on
> PGXN today.

Why? The external tool can pick the extension in its current form from
PGXN, and install it via libpq. The tool might have to jump through some
hoops to do it, and we might need some new backend functionality to
support it, but I don't see why the extension author needs to do anything.

That said, it might make the tool easier to write if we place some new
requirements for extension authors. Like, stipulate that the .sql file
is in the top-level directory of the extension tarball. But the same
extension would still be installable with "make; make install".

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2013-12-03 08:13:05 Re: logical changeset generation v6.7
Previous Message Michael Paquier 2013-12-03 07:28:36 Re: Logging WAL when updating hintbit