michelp / pgsodium

Modern cryptography for PostgreSQL using libsodium.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

only pgsodium 1.0.0 is available for installation on PostgreSQL 9.6

vitabaks opened this issue · comments

Error installing the extension on PostgreSQL 9.6

available version for installation

postgres=# select name, default_version as version, comment from pg_available_extensions where name like '%pgsodium%' order by 1
postgres-# ;
   name   | version |                  comment                   
----------+---------+--------------------------------------------
 pgsodium | 2.0.2   | Postgres extension for libsodium functions
(1 row)

create extension

postgres=# CREATE EXTENSION pgsodium;
ERROR:  could not stat file "/usr/share/postgresql/9.6/extension/pgsodium--2.0.2.sql": No such file or directory

lists the specific extension versions that are available for installation

postgres=# select * from pg_available_extension_versions where name = 'pgsodium' order by version desc;
   name   | version | installed | superuser | relocatable | schema | requires |                  comment                   
----------+---------+-----------+-----------+-------------+--------+----------+--------------------------------------------
 pgsodium | 1.0.0   | f         | t         | t           |        |          | Postgres extension for libsodium functions
(1 row)

we can only install version 1.0.0

postgres=# CREATE EXTENSION pgsodium WITH VERSION '1.0.0';
CREATE EXTENSION
postgres=# \dx
                         List of installed extensions
   Name   | Version |   Schema   |                Description                 
----------+---------+------------+--------------------------------------------
 pgsodium | 1.0.0   | public     | Postgres extension for libsodium functions
 plpgsql  | 1.0     | pg_catalog | PL/pgSQL procedural language
(2 rows)

without the possibility of updating

error:

postgres=# ALTER EXTENSION pgsodium UPDATE;
ERROR:  syntax error at or near "FROM"
LINE 2:    REVOKE ALL ON FUNCTION derive_key FROM PUBLIC;
                                             ^
QUERY:  
			REVOKE ALL ON FUNCTION derive_key FROM PUBLIC;
			GRANT EXECUTE ON FUNCTION derive_key TO pgsodium_keymaker;
		
CONTEXT:  PL/pgSQL function inline_code_block line 29 at EXECUTE

list of extension files

root@6d7ebcea4a6f:/# ls -l /usr/share/postgresql/9.6/extension/ | grep pgsodium
-rw-r--r-- 1 root root    6300 Oct 17 19:18 pgsodium--1.0.0--1.1.0.sql
-rw-r--r-- 1 root root    4606 Oct 17 19:18 pgsodium--1.0.0.sql
-rw-r--r-- 1 root root      59 Oct 17 19:18 pgsodium--1.1.0--1.1.1.sql
-rw-r--r-- 1 root root    6731 Oct 17 19:18 pgsodium--1.1.1--1.2.0.sql
-rw-r--r-- 1 root root    7076 Oct 17 19:18 pgsodium--1.2.0--2.0.0.sql
-rw-r--r-- 1 root root       0 Oct 17 19:18 pgsodium--2.0.0--2.0.1.sql
-rw-r--r-- 1 root root       0 Oct 17 19:18 pgsodium--2.0.1--2.0.2.sql
-rw-r--r-- 1 root root     135 Oct 17 19:18 pgsodium.control

To be more precise, it is possible to update the extension to version 1.1.1

postgres=# ALTER EXTENSION pgsodium UPDATE TO '1.1.0';
ALTER EXTENSION
postgres=# \dx
                         List of installed extensions
   Name   | Version |   Schema   |                Description                 
----------+---------+------------+--------------------------------------------
 pgsodium | 1.1.0   | public     | Postgres extension for libsodium functions
 plpgsql  | 1.0     | pg_catalog | PL/pgSQL procedural language
(2 rows)

postgres=# ALTER EXTENSION pgsodium UPDATE TO '1.1.1';
ALTER EXTENSION
postgres=# \dx
                         List of installed extensions
   Name   | Version |   Schema   |                Description                 
----------+---------+------------+--------------------------------------------
 pgsodium | 1.1.1   | public     | Postgres extension for libsodium functions
 plpgsql  | 1.0     | pg_catalog | PL/pgSQL procedural language
(2 rows)

postgres=# ALTER EXTENSION pgsodium UPDATE TO '1.2.0';
ERROR:  syntax error at or near "FROM"
LINE 2:    REVOKE ALL ON FUNCTION derive_key FROM PUBLIC;
                                             ^
QUERY:  
			REVOKE ALL ON FUNCTION derive_key FROM PUBLIC;
			GRANT EXECUTE ON FUNCTION derive_key TO pgsodium_keymaker;
		
CONTEXT:  PL/pgSQL function inline_code_block line 29 at EXECUTE

no problem installing the extension on PostgreSQL 10, 11, 12, 13

psql (10.22 (Debian 10.22-1.pgdg110+1))
Type "help" for help.

postgres=# CREATE EXTENSION pgsodium;
CREATE EXTENSION
postgres=# \dx
                               List of installed extensions
   Name   | Version |   Schema   |                       Description                       
----------+---------+------------+---------------------------------------------------------
 pgsodium | 2.0.2   | public     | Pgsodium is a modern cryptography library for Postgres.
 plpgsql  | 1.0     | pg_catalog | PL/pgSQL procedural language
(2 rows)

Error installing the pgsodium version 3.0.4 on PostgreSQL 14 and 15 #35