Skip to content

Commit a2087c6

Browse files
max-ibragimowMax Ibragimov
and
Max Ibragimov
authored
Release 1.6.0
Co-authored-by: Max Ibragimov <maxim.ibragimov@tantorlabs.ru>
1 parent 6585785 commit a2087c6

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ It uses the following tools:
221221
- PostgreSQL [`pg_dump`](https://www.postgresql.org/docs/current/app-pgdump.html) tool for dumping the database structure.
222222
- PostgreSQL [`pg_restore`](https://www.postgresql.org/docs/current/app-pgrestore.html) tool for restoring the database structure.
223223

224-
**Warning:** Requires PostgreSQL 14 or higher
224+
**Warning:** Requires PostgreSQL 9.6 or higher
225225

226226
## Installation Guide
227227

pg_anon/common/constants.py

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"application_name": "pg_anon",
55
"statement_timeout": "0",
66
"lock_timeout": "0",
7+
}
8+
9+
TRANSACTIONS_SERVER_SETTINGS = {
710
"idle_in_transaction_session_timeout": "0",
811
"idle_session_timeout": "0",
912
}

pg_anon/context.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
from typing import Dict, Optional
44

5-
from pg_anon.common.constants import ANON_UTILS_DB_SCHEMA_NAME, SERVER_SETTINGS
5+
from pg_anon.common.constants import ANON_UTILS_DB_SCHEMA_NAME, SERVER_SETTINGS, TRANSACTIONS_SERVER_SETTINGS
66
from pg_anon.common.dto import ConnectionParams
77
from pg_anon.common.enums import VerboseOptions, AnonMode, ScanMode
88
from pg_anon.common.utils import exception_handler, parse_comma_separated_list, read_yaml
@@ -413,11 +413,14 @@ def get_arg_parser():
413413

414414
def set_postgres_version(self, pg_version: str):
415415
self.pg_version = pg_version
416+
pg_major_version = int(pg_version.split('.')[0])
417+
418+
if pg_major_version >= 14:
419+
self.server_settings.update(TRANSACTIONS_SERVER_SETTINGS)
420+
416421
if not self.config:
417422
return
418423

419-
pg_major_version = int(pg_version.split('.')[0])
420-
421424
utils_versions = self.config.get('pg-utils-versions')
422425
pg_utils = utils_versions.get(pg_major_version)
423426
if not pg_utils:

0 commit comments

Comments
 (0)