MigOpsRepos / credcheck

PostgreSQL plain credential checker
MIT License
57 stars 5 forks source link

credcheck version history/name mismatch #15

Closed t-ushar closed 1 year ago

t-ushar commented 1 year ago

Hi Team,

I was using credcheck version. - "1.0.0"

postgres=# \dx
                                            List of installed extensions
        Name        | Version |   Schema   |                              Description                               
--------------------+---------+------------+------------------------------------------------------------------------
 credcheck          | 1.0.0   | public     | credcheck - postgresql plain text credential checker

Post I installed new version (1.2.1) https://download.postgresql.org/pub/repos/yum/13/redhat/rhel-7.9-x86_64/credcheck_13-1.2-1.rhel7.x86_64.rpm

I did an extension update. And, I am expecting the version should be 1.2.1. however, I see a different version.

installed/updated new rpm

yum install credcheck_13
Loaded plugins: changelog, verify, versionlock
Resolving Dependencies
--> Running transaction check
---> Package credcheck_13.x86_64 0:1.0-1.rhel7 will be updated
---> Package credcheck_13.x86_64 0:1.2-1.rhel7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================================================
 Package                                       Arch                                    Version                                         Repository                                Size
======================================================================================================================================================================================
Updating:
 credcheck_13                                  x86_64                                  1.2-1.rhel7                                     pg13                                   22 k

Transaction Summary
======================================================================================================================================================================================
Upgrade  1 Package

Total download size: 22 k
Is this ok [y/d/N]: y
Downloading packages:
credcheck_13-1.2-1.rhel7.x86_64.rpm                                                                                                                            |  22 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Updating   : credcheck_13-1.2-1.rhel7.x86_64                                                                                                                                    1/2 
  Cleanup    : credcheck_13-1.0-1.rhel7.x86_64                                                                                                                                    2/2 
  Verifying  : credcheck_13-1.2-1.rhel7.x86_64                                                                                                                                    1/2 
  Verifying  : credcheck_13-1.0-1.rhel7.x86_64                                                                                                                                    2/2 

Updated:
  credcheck_13.x86_64 0:1.2-1.rhel7                                                                                                                                                   

updated extension on the DB level and showing the wrong version number.


postgres=# \dx credcheck
                            List of installed extensions
   Name    | Version | Schema |                     Description                      
-----------+---------+--------+------------------------------------------------------
 credcheck | 1.0.0   | public | credcheck - postgresql plain text credential checker
(1 row)

postgres=# alter extension credcheck UPDATE ;
ALTER EXTENSION
postgres=# \dx credcheck
                            List of installed extensions
   Name    | Version | Schema |                     Description                      
-----------+---------+--------+------------------------------------------------------
 credcheck | 1.1.0   | public | credcheck - postgresql plain text credential checker
(1 row)

Please correct me if I understood wrong. I am expecting the version should be 1.2.1

darold commented 1 year ago

Hum, right. It look like I have forgotten to increase the version number in file credcheck.control and to create the update file. I will fixed that in next release soon.

The solution for you is to modify manually the file /usr/pgsql-13/share/extension/credcheck.control and set

default_version = '1.2.0'

and create the update file as follow:

sudo touch /usr/pgsql-13/share/extension/credcheck--1.1.0--1.2.0.sql

Actually there is no SQL modification so the most important is that the library is installed, but I agree that the extension version number must reflect was it is.

Sorry for the inconveniences.

t-ushar commented 1 year ago

Thanks for the update @darold.

darold commented 1 year ago

Fixed in new version v2.0