Re: Extension Templates S03E11

From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, 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 13:43:51
Message-ID: m261r6jbhk.fsf@2ndQuadrant.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> Can we separate this feature out? It's an issue with extensions today,
>> and I'm eager to make some progress after the explosion of differing
>> opinions today.
>
> +1 for separating that part out. I thought it was separated, at some point.

http://www.postgresql.org/message-id/CALtqXTetVi-eXhdBSpUey3TrthuG51esWUOd8cUR2t+RxtgEKg@mail.gmail.com
http://www.postgresql.org/message-id/m2r4k8jpfl.fsf@2ndQuadrant.fr

The only way for to bugfix all the reported problems had been to have
regression testing… and it's become a necessary dependency of the
extension templates patch, so I just included it in.

My interdependent git branches development fu seems to have totally
disappeared after the main extension patch that needed 7 of thoses…

> I'd need to look exactly what's being proposed in more detail.

What I did propose is a new GUC default_full_version:

+ <term><varname>default_full_version</varname> (<type>string</type>)</term>
+ <listitem>
+ <para>
+ This option allows an extension author to avoid shiping all versions
+ of all scripts when shipping an extension. When a version is requested
+ and the matching script does not exist on disk,
+ set <replaceable>default_full_version</replaceable> to the first
+ script you still ship and PostgreSQL will apply the intermediate
+ upgrade script as per the <command>ALTER EXTENSION UPDATE</command>
+ command.
+ </para>
+ <para>
+ For example, say you did provide the extension <literal>pair</literal>
+ version <literal>1.0</literal> and are now providing the
+ version <literal>1.1</literal>. If you want both current and new users
+ to be able to install the new version, you can provide both the
+ scripts <literal>pair--1.0--1.1.sql</literal>
+ and <literal>pair--1.1.sql</literal>, adding to the already
+ existing <literal>pair--1.0.sql</literal>.
+ </para>
+ <para>
+ When specifying <literal>default_version</literal>
+ and <literal>default_full_version = 1.0</literal> you can instead only
+ provide only the scripts <literal>pair--1.0.sql</literal>
+ and <literal>pair-1.0--1.1.sql</literal>. The <command>CREATE
+ EXTENSION pair;</command> will then automatically use the afore
+ mentionned scripts to install version 1.0 then update it to 1.1.
+ </para>
+ </listitem>

What Jeff is proposing is to simplify that down and have PostgreSQL auto
discover the upgrade cycle when the version asked for isn't directly
available with a creation script.

We would keep the behavior depicted here, just in a fully automated way.

Working on a separate patch for that, then.

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 Stephen Frost 2013-12-03 13:44:49 Re: Extension Templates S03E11
Previous Message Metin Doslu 2013-12-03 13:41:43 Parallel Select query performance and shared buffers