postgresql-container icon indicating copy to clipboard operation
postgresql-container copied to clipboard

Add support for extensions loading and creation.

Open mscherer opened this issue 4 years ago • 18 comments

Using POSTGRESQL_LIBRARIES and POSTGRESQL_EXTENSIONS allow users to enable extensions (some bundled in the container) without having to do anything but adding 2 variables.

mscherer avatar Feb 17 '21 18:02 mscherer

Can one of the admins verify this patch?

centos-ci avatar Feb 17 '21 18:02 centos-ci

Can one of the admins verify this patch?

centos-ci avatar Feb 17 '21 18:02 centos-ci

Can one of the admins verify this patch?

centos-ci avatar Feb 17 '21 18:02 centos-ci

Why did you remove file 10_pgaudit.conf. shared_preload_libraries = 'pgaudit' is set only for test? It is not needed in the container for users at all?

phracek avatar Jul 16 '21 09:07 phracek

[test]

phracek avatar Jul 16 '21 09:07 phracek

I removed it because this is used in the test, and would interfer with them.

However, you are right, removing the file make the example incorrect, as the whole README is no longer correct.

A better solution would be to either remove the cp line and keep the example as is, or duplicate the test, so we can test the old way, and the new one.

I will send a updated PR once the tests are finished.

mscherer avatar Jul 16 '21 09:07 mscherer

I just got done deploying Postgres13 from these changes as a back end to my Discourse instance. They worked for me and allowed me to automate the processes I have been struggling to automate cleanly for a while now. We are going to either need to maintain these changes or have them upstreamed for a Discourse Template we plan to go live somewhere close to next week.

I built it from the instructions in the first README.md. The following might be useful if it was updated to reflect the steps to build on Fedora, e.g. from:

$ git clone --recursive https://github.com/sclorg/postgresql-container.git
$ cd postgresql
$ make build TARGET=rhel7 VERSIONS=13

to something like:

$ git clone --recursive https://github.com/sclorg/postgresql-container.git
$ cd postgresql
# dnf install podman-docker go-md2man distgen
$ make build TARGET=rhel7 VERSIONS=13

jontrossbach avatar Jul 16 '21 21:07 jontrossbach

Ok so I tried my best to test the old way and the new way.

And for the failure on testing-farm.io, I am unsure what to do, I rebased hoping this would somehow fix the problem.

mscherer avatar Jul 20 '21 12:07 mscherer

[test]

hhorak avatar Sep 15 '21 09:09 hhorak

Last push should fix the error:

12:17:33 test/run: line 862: DOCKER_EXTRA_ARGS: unbound variable

(which is the only error I see on https://ci.centos.org/job/SCLo-container-postgresql-rh-fedora/292/timestamps/?time=HH:mm:ss&timeZone=GMT+2&appendLog&locale=en_GB )

mscherer avatar Sep 15 '21 15:09 mscherer

So I regenerated like the other PR.

mscherer avatar Sep 22 '22 14:09 mscherer

I rebased again (conflicts).

mscherer avatar Feb 22 '23 14:02 mscherer

@mscherer Please rebase it against master including common submodule.

phracek avatar Oct 03 '23 08:10 phracek

Rebased

[test]

phracek avatar Oct 03 '23 08:10 phracek

Let's test after generated sources.

[test]

phracek avatar Oct 03 '23 10:10 phracek

Strange behaviour.

There is an error in test/run script:

-----------------------------------------------
Running test run_pgaudit_test (starting at 2023-10-03 10:26:59+00:00) ... 
-----------------------------------------------
c644c8223c59eb64a932a2d1cd2e13e9f3bee4a1c7fd79ec69e1df6e37a788c0
Created container c644c8223c59eb64a932a2d1cd2e13e9f3bee4a1c7fd79ec69e1df6e37a788c0
test/run: line 340: $1: unbound variable
Tests finished with EXIT=1

Tests are passing:

==============================================
Tests were run for image quay.io/sclorg/postgresql-15-c9s:1
==============================================
Test cases results:

 [PASSED] for 'postgresql-container_tests' run_container_creation_tests (00:00:19)
 [PASSED] for 'postgresql-container_tests' run_general_tests (00:00:39)
 [PASSED] for 'postgresql-container_tests' run_change_password_test (00:00:07)
 [PASSED] for 'postgresql-container_tests' run_replication_test (00:00:06)
 [PASSED] for 'postgresql-container_tests' run_doc_test (00:00:00)
 [PASSED] for 'postgresql-container_tests' run_s2i_test (00:00:14)
 [PASSED] for 'postgresql-container_tests' run_test_cfg_hook (00:00:08)
 [PASSED] for 'postgresql-container_tests' run_s2i_bake_data_test (00:00:12)
 [PASSED] for 'postgresql-container_tests' run_s2i_enable_ssl_test (00:00:08)
 [PASSED] for 'postgresql-container_tests' run_upgrade_test (00:00:00)
 [PASSED] for 'postgresql-container_tests' run_migration_test (00:00:23)

phracek avatar Oct 03 '23 10:10 phracek

@mscherer Please address my comments, if they are relevant.

phracek avatar Oct 03 '23 14:10 phracek

Strange behaviour.

There is an error in test/run script:

-----------------------------------------------
Running test run_pgaudit_test (starting at 2023-10-03 10:26:59+00:00) ... 
-----------------------------------------------
c644c8223c59eb64a932a2d1cd2e13e9f3bee4a1c7fd79ec69e1df6e37a788c0
Created container c644c8223c59eb64a932a2d1cd2e13e9f3bee4a1c7fd79ec69e1df6e37a788c0
test/run: line 340: $1: unbound variable
Tests finished with EXIT=1

Tests are passing:

==============================================
Tests were run for image quay.io/sclorg/postgresql-15-c9s:1
==============================================
Test cases results:

 [PASSED] for 'postgresql-container_tests' run_container_creation_tests (00:00:19)
 [PASSED] for 'postgresql-container_tests' run_general_tests (00:00:39)
 [PASSED] for 'postgresql-container_tests' run_change_password_test (00:00:07)
 [PASSED] for 'postgresql-container_tests' run_replication_test (00:00:06)
 [PASSED] for 'postgresql-container_tests' run_doc_test (00:00:00)
 [PASSED] for 'postgresql-container_tests' run_s2i_test (00:00:14)
 [PASSED] for 'postgresql-container_tests' run_test_cfg_hook (00:00:08)
 [PASSED] for 'postgresql-container_tests' run_s2i_bake_data_test (00:00:12)
 [PASSED] for 'postgresql-container_tests' run_s2i_enable_ssl_test (00:00:08)
 [PASSED] for 'postgresql-container_tests' run_upgrade_test (00:00:00)
 [PASSED] for 'postgresql-container_tests' run_migration_test (00:00:23)

@phracek Hi, have you encountered this problem repeatedly? I will create a issue from this so we will not forget it.

zmiklank avatar Nov 21 '23 08:11 zmiklank