Re: SQL objects UNITs (was: Extension Templates S03E11)

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>, Simon Riggs <simon(at)2ndQuadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jeff Davis <pgsql(at)j-davis(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Boszormenyi Zoltan <zb(at)cybertec(dot)at>, Thom Brown <thom(at)linux(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SQL objects UNITs (was: Extension Templates S03E11)
Date: 2013-12-18 15:05:01
Message-ID: 20131218150501.GA11006@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Stephen Frost escribió:
> * Dimitri Fontaine (dimitri(at)2ndQuadrant(dot)fr) wrote:

> > Basically with building `UNIT` we realise with hindsight that we failed to
> > build a proper `EXTENSION` system, and we send that message to our users.
>
> Little difficult to draw conclusions about what out 'hindsight' will
> look like.

I haven't been keeping very close attention to this, but I fail to see
why extensions are so much of a failure. Surely we can invent a new
"kind" of extensions, ones whose contents specifically are dumped by
pg_dump. Regular extensions, the kind we have today, still wouldn't,
but we could have a flag, say "CREATE EXTENSION ... (WITH DUMP)" or
something. That way you don't have to come up with UNIT at all (or
whatever). A whole new set of catalogs just to fix up a minor issue
with extensions sounds a bit too much to me; we can just add this new
thing on top of the existing infrastructure.

I didn't much like the WITH UNIT/END UNIT thingy. What's wrong with
CREATE foo; ALTER EXTENSION ADD foo? There's a bit of a problem that if
you create the object and die before being able to add it to the
extension, it would linger unreferenced; but that's easily fixable by
doing the creation in a transaction, I think. (Alternatively, we could
have a single command that creates the extension and the contained
objects in one fell swoop, similar to how CREATE SCHEMA can do it; but
I'm not sure that's all that much better, and from a grammar POV it
probably sucks.)

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-12-18 15:06:38 Re: pg_rewarm status
Previous Message Robert Haas 2013-12-18 15:03:19 Re: pg_rewarm status