2

I'm trying to enable wal2json in an image extended from postgres:12 image. But i'm getting an error:

postgres=# create extension wal2json;
ERROR:  could not open extension control file "/usr/share/postgresql/12/extension/wal2json.control": No such file or directory

This might be because wal2json is also missing from pg_available_extensions:

postgres=# select * from pg_available_extensions where name ilike '%%json%%';
 name | default_version | installed_version | comment 
------+-----------------+-------------------+---------
(0 rows)

Dockerfile:

FROM postgres:12
RUN apt update && apt install -y postgresql-12-wal2json postgresql-contrib

postgres server logs:

db_1  | 2020-05-10 13:53:04.611 GMT [1] LOG:  database system is ready to accept connections
db_1  | 2020-05-10 13:54:03.587 GMT [83] ERROR:  could not open extension control file "/usr/share/postgresql/12/extension/wal2json.control": No such file or directory
db_1  | 2020-05-10 13:54:03.587 GMT [83] STATEMENT:  create extension wal2json;

the postgresql.conf file has been tweaked to

wal_level = logical     
shared_preload_libraries = 'wal2json'

Any help with getting this working will be appreciated.

1
  • "RUN apt update && apt install -y postgresql-12-wal2json postgresql-contrib" Does this complete without error?
    – jjanes
    May 10, 2020 at 19:20

1 Answer 1

0

2 years later, on postgresql-14 with wal2json. After installing with debezium docker image : https://hub.docker.com/r/debezium/postgres/tags

Which basically does what you did https://github.com/debezium/container-images/blob/023a7da62f802051b15e3991e2a28f8d705e8d40/postgres/14/Dockerfile

I'm able to use the wal2json extension through a repl slot

SELECT * FROM pg_create_logical_replication_slot('testing', 'wal2json')

without activating the extension with a CREATE EXTENSION

A user on the debezium gitter was mind blown by this. I don't know how if it's supposed to work like so; but it does apparently.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.