mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Initial support for PG 10.0, per #2214 (missed some files)
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
SELECT
|
||||
last_value,
|
||||
seqmin AS min_value,
|
||||
seqmax AS max_value,
|
||||
seqstart AS start_value,
|
||||
seqcache AS cache_value,
|
||||
seqcycle AS is_cycled,
|
||||
seqincrement AS increment_by,
|
||||
is_called
|
||||
FROM pg_sequence, {{ conn|qtIdent(data.schema) }}.{{ conn|qtIdent(data.name) }}
|
||||
WHERE seqrelid = '{{ conn|qtIdent(data.schema) }}.{{ conn|qtIdent(data.name) }}'::regclass
|
||||
@@ -0,0 +1,9 @@
|
||||
SELECT CASE WHEN usesuper
|
||||
THEN pg_is_in_recovery()
|
||||
ELSE FALSE
|
||||
END as inrecovery,
|
||||
CASE WHEN usesuper AND pg_is_in_recovery()
|
||||
THEN pg_is_wal_replay_paused()
|
||||
ELSE FALSE
|
||||
END as isreplaypaused
|
||||
FROM pg_user WHERE usename=current_user
|
||||
@@ -0,0 +1,46 @@
|
||||
import os
|
||||
|
||||
from pgadmin.utils.route import BaseTestGenerator
|
||||
from regression.python_test_utils import test_utils
|
||||
|
||||
|
||||
class TestCheckRecovery(BaseTestGenerator):
|
||||
|
||||
scenarios = [
|
||||
("Test for check recovery", dict())
|
||||
]
|
||||
|
||||
def runTest(self):
|
||||
|
||||
cursor = test_utils.get_db_connection(self.server['db'],
|
||||
self.server['username'],
|
||||
self.server['db_password'],
|
||||
self.server['host'],
|
||||
self.server['port']).cursor()
|
||||
|
||||
if cursor is not None and cursor.connection is not None:
|
||||
server_version = cursor.connection.server_version
|
||||
if server_version >= 100000:
|
||||
version = '10.0_plus'
|
||||
elif server_version >= 90000:
|
||||
version = '9.0_plus'
|
||||
else:
|
||||
version = 'default'
|
||||
|
||||
template_file = os.path.join(
|
||||
os.path.dirname(__file__), "../templates/connect/sql", version,
|
||||
"check_recovery.sql"
|
||||
)
|
||||
|
||||
cursor.execute(open(template_file, 'r').read())
|
||||
fetch_result = cursor.fetchall()
|
||||
|
||||
first_row = {}
|
||||
for index, description in enumerate(cursor.description):
|
||||
first_row[description.name] = fetch_result[0][index]
|
||||
|
||||
in_recovery = first_row['inrecovery']
|
||||
wal_paused = first_row['isreplaypaused']
|
||||
|
||||
self.assertEqual(False, in_recovery)
|
||||
self.assertEqual(False, wal_paused)
|
||||
Reference in New Issue
Block a user