Re: Extension Templates S03E11

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: Extension Templates S03E11
Дата
Msg-id m261r6jbhk.fsf@2ndQuadrant.fr
обсуждение исходный текст
Ответ на Re: Extension Templates S03E11  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Extension Templates S03E11
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Extension Templates S03E11
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: Extension Templates S03E11