diff --git a/.github/workflows/run-python-tests-epas.yml b/.github/workflows/run-python-tests-epas.yml index 794636f98..3c4615829 100644 --- a/.github/workflows/run-python-tests-epas.yml +++ b/.github/workflows/run-python-tests-epas.yml @@ -65,7 +65,7 @@ jobs: run: | FOR /f "delims=" %%F IN ('python tools\get_sb_package.py "${{ secrets.EDB_SBP_URL }}" "edb_as${{ matrix.pgver }}_dbserver" "windows-x64"') DO SET INSTALLER_EXE=%%F ECHO Running %INSTALLER_EXE%... - %INSTALLER_EXE% --prefix C:\EPAS\${{ matrix.pgver }} --datadir C:\EPAS\${{ matrix.pgver }}\data --serverport 59${{ matrix.pgver }} --superpassword enterprisedb --create_samples no --install_runtimes 0 --mode unattended --unattendedmodeui none --disable-components stackbuilderplus${{ matrix.pgver < 15 && ',pgadmin4' || '' }} + %INSTALLER_EXE% --prefix C:\EPAS\${{ matrix.pgver }} --datadir C:\EPAS\${{ matrix.pgver }}\data --serverport 58${{ matrix.pgver }} --superpassword enterprisedb --create_samples no --install_runtimes 0 --mode unattended --unattendedmodeui none --disable-components stackbuilderplus${{ matrix.pgver < 15 && ',pgadmin4' || '' }} choco install -y mitkerberos @@ -105,38 +105,23 @@ jobs: run: | # Note: we use a custom port for PostgreSQL as the runner may already have a version of PostgreSQL installed sudo su -c "echo local all all trust > /etc/edb-as/${{ matrix.pgver }}/main/pg_hba.conf" - sudo su -c "echo host all all 127.0.0.1/32 trust >> /etc/edb-as/${{ matrix.pgver }}/main/pg_hba.conf" - sudo su -c "echo host all all ::1/128 trust >> /etc/edb-as/${{ matrix.pgver }}/main/pg_hba.conf" - sudo su -c "echo host replication postgres 127.0.0.1/32 trust >> /etc/edb-as/${{ matrix.pgver }}/main/pg_hba.conf" - sudo su -c "echo host replication postgres ::1/128 trust >> /etc/edb-as/${{ matrix.pgver }}/main/pg_hba.conf" - sudo sed -i "s/port = 544[0-9]/port = 59${{ matrix.pgver }}/g" /etc/edb-as/${{ matrix.pgver }}/main/postgresql.conf + sudo sed -i "s/port = 544[0-9]/port = 58${{ matrix.pgver }}/g" /etc/edb-as/${{ matrix.pgver }}/main/postgresql.conf sudo sed -i "s/shared_preload_libraries = '/shared_preload_libraries = '\$libdir\/plugin_debugger,/g" /etc/edb-as/${{ matrix.pgver }}/main/postgresql.conf - echo "wal_level = logical" | sudo tee -a /etc/edb-as/${{ matrix.pgver }}/main/postgresql.conf sudo su - enterprisedb -c "mkdir -p /var/run/edb-as/${{ matrix.pgver }}-main.epas_stat_tmp" sudo systemctl restart edb-as@${{ matrix.pgver }}-main - until sudo runuser -l enterprisedb -c "/usr/lib/edb-as/${{ matrix.pgver }}/bin/pg_isready -p 59${{ matrix.pgver }}" 2>/dev/null; do + until sudo runuser -l enterprisedb -c "/usr/lib/edb-as/${{ matrix.pgver }}/bin/pg_isready -p 58${{ matrix.pgver }}" 2>/dev/null; do >&2 echo "EPAS is unavailable - sleeping for 2 seconds" sleep 2 done - - name: Start PostgreSQL on Windows - if: ${{ matrix.os == 'windows-latest' }} - run: | - echo host replication postgres 127.0.0.1/32 trust >> "C:\EPAS\${{ matrix.pgver }}\data\pg_hba.conf" - echo host replication postgres ::1/128 trust >> "C:\EPAS\${{ matrix.pgver }}\data\pg_hba.conf" - echo wal_level = logical >> "C:\EPAS\${{ matrix.pgver }}\data\postgresql.conf" - net stop edb-as-${{ matrix.pgver }} - net start edb-as-${{ matrix.pgver }} - shell: cmd - - name: Create pgagent extension on Linux if: ${{ matrix.os == 'ubuntu-22.04' && matrix.pgver <= 16 }} - run: psql -U enterprisedb -d postgres -p 59${{ matrix.pgver }} -c 'CREATE EXTENSION IF NOT EXISTS pgagent;' + run: psql -U enterprisedb -d postgres -p 58${{ matrix.pgver }} -c 'CREATE EXTENSION IF NOT EXISTS pgagent;' - name: Create postgis extension on Linux if: ${{ matrix.os == 'ubuntu-22.04' }} - run: psql -U enterprisedb -d postgres -p 59${{ matrix.pgver }} -c 'CREATE EXTENSION IF NOT EXISTS postgis;' + run: psql -U enterprisedb -d postgres -p 58${{ matrix.pgver }} -c 'CREATE EXTENSION IF NOT EXISTS postgis;' - name: Install Python dependencies on Linux if: ${{ matrix.os == 'ubuntu-22.04' }} @@ -206,7 +191,7 @@ jobs: "db_username": "enterprisedb", "host": "/var/run/edb-as", "db_password": "", - "db_port": 59${{ matrix.pgver }}, + "db_port": 58${{ matrix.pgver }}, "maintenance_db": "postgres", "sslmode": "prefer", "tablespace_path": "/var/lib/edb-as/tablespaces/${{ matrix.pgver }}", @@ -280,7 +265,7 @@ jobs: @echo. "db_username": "enterprisedb", @echo. "host": "127.0.0.1", @echo. "db_password": "enterprisedb", - @echo. "db_port": 59${{ matrix.pgver }}, + @echo. "db_port": 58${{ matrix.pgver }}, @echo. "maintenance_db": "postgres", @echo. "sslmode": "prefer", @echo. "tablespace_path": "C:\\EPAS\\${{ matrix.pgver }}\\tablespaces", diff --git a/.github/workflows/run-python-tests-pg.yml b/.github/workflows/run-python-tests-pg.yml index c669a3f52..74cb40904 100644 --- a/.github/workflows/run-python-tests-pg.yml +++ b/.github/workflows/run-python-tests-pg.yml @@ -116,13 +116,8 @@ jobs: if: ${{ matrix.os == 'ubuntu-22.04' }} run: | sudo su -c "echo local all all trust > /etc/postgresql/${{ matrix.pgver }}/main/pg_hba.conf" - sudo su -c "echo host all all 127.0.0.1/32 trust >> /etc/postgresql/${{ matrix.pgver }}/main/pg_hba.conf" - sudo su -c "echo host all all ::1/128 trust >> /etc/postgresql/${{ matrix.pgver }}/main/pg_hba.conf" - sudo su -c "echo host replication postgres 127.0.0.1/32 trust >> /etc/postgresql/${{ matrix.pgver }}/main/pg_hba.conf" - sudo su -c "echo host replication postgres ::1/128 trust >> /etc/postgresql/${{ matrix.pgver }}/main/pg_hba.conf" sudo sed -i "s/port = 543[0-9]/port = 59${{ matrix.pgver }}/g" /etc/postgresql/${{ matrix.pgver }}/main/postgresql.conf sudo sed -i "s/#shared_preload_libraries = ''/shared_preload_libraries = '\$libdir\/plugin_debugger'/g" /etc/postgresql/${{ matrix.pgver }}/main/postgresql.conf - echo "wal_level = logical" | sudo tee -a /etc/postgresql/${{ matrix.pgver }}/main/postgresql.conf sudo su - postgres -c "/usr/lib/postgresql/${{ matrix.pgver }}/bin/postgres -D /var/lib/postgresql/${{ matrix.pgver }}/main -c config_file=/etc/postgresql/${{ matrix.pgver }}/main/postgresql.conf &" until sudo runuser -l postgres -c "pg_isready -p 59${{ matrix.pgver }}" 2>/dev/null; do @@ -138,12 +133,7 @@ jobs: if: ${{ matrix.os == 'macos-latest' }} run: | echo local all all trust > /opt/homebrew/var/postgresql@${{ matrix.pgver }}/pg_hba.conf - echo 'host all all 127.0.0.1/32 trust' >> /opt/homebrew/var/postgresql@${{ matrix.pgver }}/pg_hba.conf - echo 'host all all ::1/128 trust' >> /opt/homebrew/var/postgresql@${{ matrix.pgver }}/pg_hba.conf - echo 'host replication postgres 127.0.0.1/32 trust' >> /opt/homebrew/var/postgresql@${{ matrix.pgver }}/pg_hba.conf - echo 'host replication postgres ::1/128 trust' >> /opt/homebrew/var/postgresql@${{ matrix.pgver }}/pg_hba.conf sed -i '' "s/#port = 543[0-9]/port = 59${{ matrix.pgver }}/g" /opt/homebrew/var/postgresql@${{ matrix.pgver }}/postgresql.conf - echo "wal_level = logical" >> /opt/homebrew/var/postgresql@${{ matrix.pgver }}/postgresql.conf brew services restart postgresql@${{ matrix.pgver }} until /opt/homebrew/opt/postgresql@${{ matrix.pgver }}/bin/pg_isready -p 59${{ matrix.pgver }} 2>/dev/null; do @@ -153,16 +143,6 @@ jobs: psql postgres -p 59${{ matrix.pgver }} -c 'CREATE ROLE postgres SUPERUSER LOGIN;' - - name: Start PostgreSQL on Windows - if: ${{ matrix.os == 'windows-latest' }} - run: | - echo host replication postgres 127.0.0.1/32 trust >> "C:\PostgreSQL\${{ matrix.pgver }}\data\pg_hba.conf" - echo host replication postgres ::1/128 trust >> "C:\PostgreSQL\${{ matrix.pgver }}\data\pg_hba.conf" - echo wal_level = logical >> "C:\PostgreSQL\${{ matrix.pgver }}\data\postgresql.conf" - net stop postgresql-x64-${{ matrix.pgver }} - net start postgresql-x64-${{ matrix.pgver }} - shell: cmd - - name: Install Python dependencies on Linux and macOS if: ${{ matrix.os == 'macos-latest' || matrix.os == 'ubuntu-22.04' }} run: make install-python-testing diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/__init__.py index e0f540a31..080c0f411 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/__init__.py @@ -184,8 +184,8 @@ class SubscriptionView(PGChildNodeView, SchemaDiffObjectCompare): # This mapping will be used PostgresSQL 16 above streaming_mapping = { 'p': 'parallel', - 't': True, - 'f': False + 't': 'on', + 'f': 'off' } two_phase_mapping = { 'p': True, diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/static/js/subscription.ui.js b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/static/js/subscription.ui.js index 4d2bea769..751473179 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/static/js/subscription.ui.js +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/static/js/subscription.ui.js @@ -11,6 +11,12 @@ import BaseUISchema from 'sources/SchemaView/base_schema.ui'; import { isEmptyString } from 'sources/validators'; import _ from 'lodash'; +function getDefaultStreaming(version) { + if (version >= 180000) return 'parallel'; + if (version >= 160000) return 'off'; + return false; +} + export default class SubscriptionSchema extends BaseUISchema{ constructor(fieldOptions={}, node_info={}, initValues={}) { super({ @@ -26,7 +32,7 @@ export default class SubscriptionSchema extends BaseUISchema{ binary:false, two_phase:false, disable_on_error:false, - streaming: (node_info?.node_info?.version >= 180000) ? 'parallel' : false, + streaming: getDefaultStreaming(node_info?.node_info?.version), password_required:true, run_as_owner:false, origin:'any', @@ -386,24 +392,19 @@ export default class SubscriptionSchema extends BaseUISchema{ cell: 'text', group: gettext('With'), mode: ['create', 'edit', 'properties'], type: ()=>{ - let options = [ - { - 'label': gettext('On'), - value: true, - }, - { - 'label': gettext('Off'), - value: false, - } - ]; - + let options; if (obj.version >= 160000) { - options.push({ - 'label': gettext('Parallel'), - value: 'parallel', - }); + options = [ + { label: gettext('On'), value: 'on' }, + { label: gettext('Off'), value: 'off' }, + { label: gettext('Parallel'), value: 'parallel' }, + ]; + } else { + options = [ + { label: gettext('On'), value: true }, + { label: gettext('Off'), value: false }, + ]; } - return { type: 'toggle', options: options, diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/alter_parameters.sql b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/alter_parameters.sql index 7730e3680..ff62b0e00 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/alter_parameters.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/alter_parameters.sql @@ -5,4 +5,4 @@ CREATE SUBSCRIPTION test_create_subscription CONNECTION 'host=localhost port=5434 user=postgres dbname=postgres connect_timeout=10 sslmode=prefer' PUBLICATION test_pub - WITH (connect = false, enabled = false, create_slot = false, slot_name = None, synchronous_commit = 'off', binary = false, streaming = 'False', two_phase = true, disable_on_error = false, run_as_owner = true, password_required = true, origin = 'none'); + WITH (connect = false, enabled = false, create_slot = false, slot_name = None, synchronous_commit = 'off', binary = false, streaming = 'parallel', two_phase = true, disable_on_error = false, run_as_owner = true, password_required = true, origin = 'none'); diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/alter_parameters_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/alter_parameters_msql.sql index 9bd169f92..1307ccf6f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/alter_parameters_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/alter_parameters_msql.sql @@ -1,2 +1,2 @@ ALTER SUBSCRIPTION test_create_subscription - SET (synchronous_commit = 'off', binary = false, streaming = 'False', disable_on_error = false, origin = 'none'); + SET (synchronous_commit = 'off', binary = false, streaming = 'parallel', disable_on_error = false, origin = 'none'); diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/create_subscription.sql b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/create_subscription.sql index 98131ec1d..18048de55 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/create_subscription.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/create_subscription.sql @@ -5,4 +5,4 @@ CREATE SUBSCRIPTION test_create_subscription CONNECTION 'host=localhost port=5434 user=postgres dbname=postgres connect_timeout=10 sslmode=prefer' PUBLICATION test_pub - WITH (connect = false, enabled = false, create_slot = false, slot_name = None, synchronous_commit = 'remote_apply', binary = true, streaming = 'True', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any'); + WITH (connect = false, enabled = false, create_slot = false, slot_name = None, synchronous_commit = 'remote_apply', binary = true, streaming = 'on', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any'); diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/create_subscription_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/create_subscription_msql.sql index b9cb24256..f12067b0b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/create_subscription_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/create_subscription_msql.sql @@ -1,4 +1,4 @@ CREATE SUBSCRIPTION test_create_subscription CONNECTION 'host=localhost port=5434 user=postgres dbname=postgres connect_timeout=10 password=xxxxxx sslmode=prefer' PUBLICATION test_pub - WITH (connect = false, enabled = false, copy_data = false, create_slot = false, slot_name = None, synchronous_commit = 'remote_apply', binary = true, streaming = 'True', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any'); + WITH (connect = false, enabled = false, copy_data = false, create_slot = false, slot_name = None, synchronous_commit = 'remote_apply', binary = true, streaming = 'on', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any'); diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/test.json index b7c119a19..80dfbea46 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/16_plus/test.json @@ -23,7 +23,7 @@ "password": "edb", "sync": "remote_apply", "binary": true, - "streaming": true, + "streaming": "on", "disable_on_error": true, "two_phase": true, "password_required": true, @@ -44,7 +44,7 @@ "data": { "sync": "off", "binary": false, - "streaming": false, + "streaming": "parallel", "disable_on_error": false, "origin": "none" }, diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/alter_failover_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/alter_failover_parameter.sql deleted file mode 100644 index b7b4589f4..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/alter_failover_parameter.sql +++ /dev/null @@ -1,8 +0,0 @@ --- Subscription: test_create_subscription - --- DROP SUBSCRIPTION IF EXISTS test_create_subscription; - -CREATE SUBSCRIPTION test_create_subscription - CONNECTION 'host=localhost port=5917 user=postgres dbname=postgres connect_timeout=10 sslmode=prefer' - PUBLICATION test_publication - WITH (connect = false, enabled = false, create_slot = false, slot_name = test_create_subscription, synchronous_commit = 'remote_apply', binary = true, streaming = 'True', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = true); diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/alter_failover_parameter_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/alter_failover_parameter_msql.sql deleted file mode 100644 index be3891fe1..000000000 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/alter_failover_parameter_msql.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER SUBSCRIPTION test_create_subscription - SET (failover = true); diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/alter_slot_name_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/alter_slot_name_parameter.sql index f0b7614c2..fad38f4f5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/alter_slot_name_parameter.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/alter_slot_name_parameter.sql @@ -3,6 +3,6 @@ -- DROP SUBSCRIPTION IF EXISTS test_create_subscription; CREATE SUBSCRIPTION test_create_subscription - CONNECTION 'host=localhost port=5917 user=postgres dbname=postgres connect_timeout=10 sslmode=prefer' + CONNECTION 'host=localhost port=5434 user=postgres dbname=postgres connect_timeout=10 sslmode=prefer' PUBLICATION test_publication - WITH (connect = false, enabled = false, create_slot = false, slot_name = None, synchronous_commit = 'remote_apply', binary = true, streaming = 'True', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = true); + WITH (connect = false, enabled = false, create_slot = false, slot_name = None, synchronous_commit = 'remote_apply', binary = true, streaming = 'on', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = false); diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/create_subscription.sql b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/create_subscription.sql index 282ef042b..3bd9974c6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/create_subscription.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/create_subscription.sql @@ -3,6 +3,6 @@ -- DROP SUBSCRIPTION IF EXISTS test_create_subscription; CREATE SUBSCRIPTION test_create_subscription - CONNECTION 'host=localhost port=5917 user=postgres dbname=postgres connect_timeout=10 sslmode=prefer' + CONNECTION 'host=localhost port=5434 user=postgres dbname=postgres connect_timeout=10 sslmode=prefer' PUBLICATION test_publication - WITH (connect = false, enabled = false, create_slot = false, slot_name = test_create_subscription, synchronous_commit = 'remote_apply', binary = true, streaming = 'True', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = false); + WITH (connect = false, enabled = false, create_slot = false, slot_name = test_create_subscription, synchronous_commit = 'remote_apply', binary = true, streaming = 'on', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = false); diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/create_subscription_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/create_subscription_msql.sql index 4bd1a7a03..9b199d677 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/create_subscription_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/create_subscription_msql.sql @@ -1,4 +1,4 @@ CREATE SUBSCRIPTION test_create_subscription - CONNECTION 'host=localhost port=5917 user=postgres dbname=postgres connect_timeout=10 password=xxxxxx sslmode=prefer' + CONNECTION 'host=localhost port=5434 user=postgres dbname=postgres connect_timeout=10 password=xxxxxx sslmode=prefer' PUBLICATION test_publication - WITH (connect = true, enabled = false, copy_data = false, create_slot = false, slot_name = test_create_subscription, synchronous_commit = 'remote_apply', binary = true, streaming = 'True', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = false); + WITH (connect = false, enabled = false, copy_data = false, create_slot = false, slot_name = test_create_subscription, synchronous_commit = 'remote_apply', binary = true, streaming = 'on', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = false); diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/test.json index 56b016f23..f1fe0a311 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/17_plus/test.json @@ -34,7 +34,6 @@ "endpoint": "NODE-publication.obj", "sql_endpoint": "NODE-publication.sql_id", "msql_endpoint": "NODE-publication.msql", - "precondition_sql": "SELECT 1 FROM pg_replication_slots WHERE slot_name = 'test_create_subscription' UNION ALL SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'test_create_subscription') AND pg_create_logical_replication_slot('test_create_subscription', 'pgoutput', false) IS NOT NULL LIMIT 1;", "data": { "name": "test_publication", "evnt_insert": true, @@ -61,7 +60,7 @@ "name": "test_create_subscription", "subowner": "postgres", "host": "localhost", - "port": 5917, + "port": 5434, "db": "postgres", "username": "postgres", "password": "postgres", @@ -71,10 +70,10 @@ "copy_data": false, "create_slot": false, "enabled": false, - "connect": true, + "connect": false, "slot_name": "test_create_subscription", "sync": "remote_apply", - "streaming": true, + "streaming": "on", "binary": true, "two_phase": true, "disable_on_error": true, @@ -87,18 +86,6 @@ "expected_sql_file": "create_subscription.sql", "expected_msql_file": "create_subscription_msql.sql" }, - { - "type": "alter", - "name": "Alter failover parameter of subscription", - "endpoint": "NODE-subscription.obj_id", - "sql_endpoint": "NODE-subscription.sql_id", - "msql_endpoint": "NODE-subscription.msql_id", - "data": { - "failover": true - }, - "expected_sql_file": "alter_failover_parameter.sql", - "expected_msql_file": "alter_failover_parameter_msql.sql" - }, { "type": "alter", "name": "Alter slot_name parameter of subscription", @@ -117,8 +104,7 @@ "endpoint": "NODE-subscription.delete_id", "data": { "name": "test_create_subscription" - }, - "post_scenario_sql": "SELECT 1 WHERE EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'test_create_subscription') AND (SELECT pg_drop_replication_slot('test_create_subscription')) IS NOT NULL UNION ALL SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'test_create_subscription') LIMIT 1;" + } } ] } diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/alter_slot_name_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/alter_slot_name_parameter.sql index e2e2e1977..fad38f4f5 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/alter_slot_name_parameter.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/alter_slot_name_parameter.sql @@ -5,4 +5,4 @@ CREATE SUBSCRIPTION test_create_subscription CONNECTION 'host=localhost port=5434 user=postgres dbname=postgres connect_timeout=10 sslmode=prefer' PUBLICATION test_publication - WITH (connect = false, enabled = false, create_slot = false, slot_name = None, synchronous_commit = 'remote_apply', binary = true, streaming = 'True', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = false); + WITH (connect = false, enabled = false, create_slot = false, slot_name = None, synchronous_commit = 'remote_apply', binary = true, streaming = 'on', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = false); diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/alter_two_phase_parameter.sql b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/alter_two_phase_parameter.sql index 1fbcd8e84..3bd9974c6 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/alter_two_phase_parameter.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/alter_two_phase_parameter.sql @@ -5,4 +5,4 @@ CREATE SUBSCRIPTION test_create_subscription CONNECTION 'host=localhost port=5434 user=postgres dbname=postgres connect_timeout=10 sslmode=prefer' PUBLICATION test_publication - WITH (connect = false, enabled = false, create_slot = false, slot_name = test_create_subscription, synchronous_commit = 'remote_apply', binary = true, streaming = 'True', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = false); + WITH (connect = false, enabled = false, create_slot = false, slot_name = test_create_subscription, synchronous_commit = 'remote_apply', binary = true, streaming = 'on', two_phase = true, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = false); diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/create_subscription.sql b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/create_subscription.sql index 037c3e7a8..c1f7fce27 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/create_subscription.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/create_subscription.sql @@ -5,4 +5,4 @@ CREATE SUBSCRIPTION test_create_subscription CONNECTION 'host=localhost port=5434 user=postgres dbname=postgres connect_timeout=10 sslmode=prefer' PUBLICATION test_publication - WITH (connect = false, enabled = false, create_slot = false, slot_name = test_create_subscription, synchronous_commit = 'remote_apply', binary = true, streaming = 'True', two_phase = false, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = false); + WITH (connect = false, enabled = false, create_slot = false, slot_name = test_create_subscription, synchronous_commit = 'remote_apply', binary = true, streaming = 'on', two_phase = false, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = false); diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/create_subscription_msql.sql b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/create_subscription_msql.sql index 4215305e1..881331729 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/create_subscription_msql.sql +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/create_subscription_msql.sql @@ -1,4 +1,4 @@ CREATE SUBSCRIPTION test_create_subscription CONNECTION 'host=localhost port=5434 user=postgres dbname=postgres connect_timeout=10 password=xxxxxx sslmode=prefer' PUBLICATION test_publication - WITH (connect = false, enabled = false, copy_data = false, create_slot = false, slot_name = test_create_subscription, synchronous_commit = 'remote_apply', binary = true, streaming = 'True', two_phase = false, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = false); + WITH (connect = false, enabled = false, copy_data = false, create_slot = false, slot_name = test_create_subscription, synchronous_commit = 'remote_apply', binary = true, streaming = 'on', two_phase = false, disable_on_error = true, run_as_owner = true, password_required = true, origin = 'any', failover = false); diff --git a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/test.json b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/test.json index f1a34c88d..602ab8ccd 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/test.json +++ b/web/pgadmin/browser/server_groups/servers/databases/subscriptions/tests/18_plus/test.json @@ -6,7 +6,6 @@ "endpoint": "NODE-subscription.obj", "sql_endpoint": "NODE-subscription.sql_id", "msql_endpoint": "NODE-subscription.msql", - "precondition_sql": "SELECT 1 FROM pg_replication_slots WHERE slot_name = 'test_create_subscription' UNION ALL SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'test_create_subscription') AND pg_create_logical_replication_slot('test_create_subscription', 'pgoutput', false) IS NOT NULL LIMIT 1;", "data": { "name": "test_create_subscription", "subowner": "postgres", @@ -24,7 +23,7 @@ "connect": false, "slot_name": "test_create_subscription", "sync": "remote_apply", - "streaming": true, + "streaming": "on", "binary": true, "two_phase": false, "disable_on_error": true, @@ -67,8 +66,7 @@ "endpoint": "NODE-subscription.delete_id", "data": { "name": "test_create_subscription" - }, - "post_scenario_sql": "SELECT 1 WHERE EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'test_create_subscription') AND (SELECT pg_drop_replication_slot('test_create_subscription')) IS NOT NULL UNION ALL SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM pg_replication_slots WHERE slot_name = 'test_create_subscription') LIMIT 1;" + } } ] }