Skip to content

Commit

Permalink
-test-
Browse files Browse the repository at this point in the history
Signed-off-by: qGYdXbY2 <[email protected]>
  • Loading branch information
qGYdXbY2 committed Jan 24, 2025
1 parent e477904 commit 77b1d4c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
3 changes: 2 additions & 1 deletion Dockerfile-postgres
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ RUN echo -e "#!/bin/sh -e \n\
echo aws_s3.endpoint_url='http://localstack:4566' >> $PGCONFFILE \n\
echo aws_s3.access_key_id='localstack' >> $PGCONFFILE \n\
echo aws_s3.secret_access_key='localstack' >> $PGCONFFILE \n\
psql -a -d postgres -U postgres -c \"SELECT pg_reload_conf();CREATE USER ro_user WITH SUPERUSER ENCRYPTED PASSWORD 'password';GRANT pg_read_all_data TO ro_user;GRANT pg_write_server_files TO ro_user;\" > /dev/null \n\
psql -a -d postgres -U postgres -c \"SELECT pg_reload_conf();DROP USER IF EXISTS ro_user;CREATE USER ro_user WITH SUPERUSER ENCRYPTED PASSWORD 'password';GRANT pg_read_all_data TO ro_user;GRANT pg_write_server_files TO ro_user;\" > /dev/null \n\
psql -a -d postgres -U postgres -c \"DROP DATABASE IF EXISTS postgres_db2;\" > /dev/null \n\
psql -a -d postgres -U postgres -c \"CREATE DATABASE postgres_db2;\" > /dev/null \n\
" > /docker-entrypoint-initdb.d/cfg_s3_dummy.sh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@ public static String generateEnsureCorrectVersionSQL(String schema){
* Install all required database extensions
*/
public static String generateMandatoryExtensionSQL(){
return "DO $$ " +
"BEGIN " +
"CREATE EXTENSION IF NOT EXISTS postgis SCHEMA public; " +
"CREATE EXTENSION IF NOT EXISTS postgis_topology; " +
"CREATE EXTENSION IF NOT EXISTS tsm_system_rows SCHEMA public; " +
"CREATE EXTENSION IF NOT EXISTS dblink SCHEMA public; " +
"CREATE EXTENSION IF NOT EXISTS plv8 SCHEMA pg_catalog; " +
"CREATE EXTENSION IF NOT EXISTS aws_s3 CASCADE; " +
"END; " +
"$$;";
}

public static String _generateMandatoryExtensionSQL(){
return "DO $$ " +
"BEGIN " +
"CREATE EXTENSION IF NOT EXISTS postgis SCHEMA public; " +
Expand Down
10 changes: 0 additions & 10 deletions xyz-util/src/main/resources/sql/common.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,7 @@ DO $installExtensions$
CREATE EXTENSION IF NOT EXISTS postgis_topology;
CREATE EXTENSION IF NOT EXISTS tsm_system_rows SCHEMA public;
CREATE EXTENSION IF NOT EXISTS dblink SCHEMA public;
BEGIN
CREATE EXTENSION IF NOT EXISTS plpython3u CASCADE;
EXCEPTION WHEN OTHERS THEN
RAISE NOTICE 'Not able to install plpython3u extension';
END;
CREATE EXTENSION IF NOT EXISTS aws_s3 CASCADE;
BEGIN
CREATE EXTENSION IF NOT EXISTS aws_lambda CASCADE;
EXCEPTION WHEN OTHERS THEN
RAISE NOTICE 'Not able to install aws_lambda extension';
END;
END;
$installExtensions$;

Expand Down

0 comments on commit 77b1d4c

Please sign in to comment.