0

So I have a custom plpgsql extension that I installed in /usr/share/postgresql/13/extension that works properly.

The problem I'm facing is that I'm trying to update the extension by replacing the test_ext--1.0.sql & test_ext.control files with updated ones- test_ext--1.1.sql.

I've updated the control file to display version 1.1.

test_ext.control

# test_ext extension
comment = 'Test Extension for dummy_schema.'
default_version = '1.1'
relocatable = true
# requires = ‘pg_stat_statements’
# directory = 'extension'

My steps where:

  1. drop the existing extension
  2. replace .SQL & control files
  3. CREATE EXTENSION test_ext SCHEMA dummy_schema;

After creating the extension, I'm still presented with the old extension rather than the new one.

                                        List of installed extensions
     Name     | Version |   Schema   |                             Description                              
--------------+---------+------------+----------------------------------------------------------------------
 test_ext     | 1.0     | dummy_schema        | Test Extension for dummy_schema.
 plpgsql      | 1.0     | pg_catalog          | PL/pgSQL procedural language
 postgres_fdw | 1.0     | dummy_schema        | foreign-data wrapper for remote PostgreSQL servers
 timescaledb  | 2.4.0   | dummy_schema        | Enables scalable inserts and complex queries for time-series data
(4 rows)

I've ran ALTER EXTENSION test_ext UPDATE to "1.1"; but I get an error saying

ERROR:  extension "test_ext" has no update path from version "1.0" to version "1.1"

I've even tried rebooting postgres service after extension install only to get same results.

I'm out of ideas.

3
  • 2
    I can't reproduce this. Dropping the extension and creating it again after changing the control file works fine for me. But it isn't clear how you "replace" the 'test_ext--1.0.sql' file, as the new one has a different name it isn't really a replacement.
    – jjanes
    Commented Nov 10, 2022 at 21:09
  • So I replace it by deleting test_ext--1.0sql with a new test_ext--1.1.sql. Are you saying I have to keep the same SQL file name?
    – Jose Lopez
    Commented Nov 11, 2022 at 14:46
  • There is no reason to delete the 1.0.sql file, you just add the 1.1.sql file. You can delete it, there just isn't any reason to.
    – jjanes
    Commented Nov 11, 2022 at 15:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.