Allow an extention to be updated without a script

From: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Allow an extention to be updated without a script
Date: 2023-01-30 20:25:02
Message-ID: 20230131052502.0f5a522832cb26b631f44459@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

I propose to add a new option "updates_without_script" to extension's
control file which a list of updates that do not need update script.
This enables to update an extension by ALTER EXTENSION even if the
extension module doesn't provide the update script.

Currently, even when we don't need to execute any command to update an
extension from one version to the next, we need to provide an update
script that doesn't contain any command. Preparing such meaningless
files are sometimes annoying.

The attached patch introduces a new option "updates_without_script"
into extension control file. This specifies a list of such updates
following the pattern 'old_version--target_version'.

For example,

updates_without_script = '1.1--1.2, 1.3--1.4'

means that updates from version 1.1 to version 1.2 and from version 1.3
to version 1.4 don't need an update script. In this case, users don't
need to prepare update scripts extension--1.1--1.2.sql and
extension--1.3--1.4.sql if it is not necessary to execute any commands.

The updated path of an extension is determined based on both the filenames
of update scripts and the list of updates specified in updates_without_script.
Presence of update script has higher priority than the option. Therefore,
if an update script is provided, the script will be executed even if this
update is specified in updates_without_script.

What do you think of this feature?
Any feedback would be appreciated.

Regards,
Yugo Nagata

--
Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>

Attachment Content-Type Size
0001-Allow-an-extention-to-be-updated-without-a-script.patch text/x-diff 18.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2023-01-30 20:27:02 Re: Non-superuser subscription owners
Previous Message Corey Huinker 2023-01-30 20:23:21 Re: Add SHELL_EXIT_CODE to psql