Re: proposal - get_extension_version function

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: proposal - get_extension_version function
Date: 2023-03-11 04:14:47
Message-ID: CAFj8pRD1zK4BverBPmOt-mUBpJQ1WNMK+a-5pU_ZER1JUYUOJQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

st 8. 3. 2023 v 17:58 odesílatel Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
napsal:

> Hi
>
> I try to write a safeguard check that ensures the expected extension
> version for an extension library.
>
> Some like
>
> const char *expected_extversion = "2.5";
>
> ...
>
> extoid = getExtensionOfObject(ProcedureRelationId,
> fcinfo->flinfo->fn_oid));
> extversion = get_extension_version(extoid);
> if (strcmp(expected_extversion, extversion) != 0)
> elog(ERROR, "extension \"%s\" needs \"ALTER EXTENSION %s UPDATE\",
> get_extension_name(extversion),
> get_extension_name(extversion)))
>
> Currently the extension version is not simply readable - I need to read
> directly from the table.
>
> Notes, comments?
>

attached patch

Regards

Pavel

>
> Regards
>
> Pavel
>
>

Attachment Content-Type Size
0001-get_extension_version-given-an-extension-OID-look-up.patch text/x-patch 2.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2023-03-11 05:13:54 Re: Dead code in ps_status.c
Previous Message Andres Freund 2023-03-11 04:10:30 Re: cpluspluscheck vs ICU