Navigation :
patroni.postgresql.misc module
-
patroni.postgresql.misc.
format_lsn
(
lsn
:
int
,
full
:
bool
=
False
)
→
str
View
on
GitHub
-
-
patroni.postgresql.misc.
fsync_dir
(
path
:
str
)
→
None
View
on
GitHub
-
-
patroni.postgresql.misc.
get_major_from_minor_version
(
version
:
int
)
→
int
View
on
GitHub
-
Extract major PostgreSQL version from the provided full version.
-
Parameters
:
-
version
– integer representation of PostgreSQL full version (major + minor).
-
Returns
:
-
integer representation of the PostgreSQL major version.
-
Example
:
-
>>> get_major_from_minor_version(100012)
100000
>>> get_major_from_minor_version(90313)
90300
-
patroni.postgresql.misc.
parse_history
(
data
:
str
)
→
Iterable
[
Tuple
[
int
,
int
,
str
]
]
View
on
GitHub
-
-
patroni.postgresql.misc.
parse_lsn
(
lsn
:
str
)
→
int
View
on
GitHub
-
-
patroni.postgresql.misc.
postgres_major_version_to_int
(
pg_version
:
str
)
→
int
View
on
GitHub
-
>>> postgres_major_version_to_int('10')
100000
>>> postgres_major_version_to_int('9.6')
90600
-
patroni.postgresql.misc.
postgres_version_to_int
(
pg_version
:
str
)
→
int
View
on
GitHub
-
Convert the server_version to integer
>>> postgres_version_to_int('9.5.3')
90503
>>> postgres_version_to_int('9.3.13')
90313
>>> postgres_version_to_int('10.1')
100001
>>> postgres_version_to_int('10')
Traceback (most recent call last):
...
PostgresException: 'Invalid PostgreSQL version format: X.Y or X.Y.Z is accepted: 10'
>>> postgres_version_to_int('9.6')
Traceback (most recent call last):
...
PostgresException: 'Invalid PostgreSQL version format: X.Y or X.Y.Z is accepted: 9.6'
>>> postgres_version_to_int('a.b.c')
Traceback (most recent call last):
...
PostgresException: 'Invalid PostgreSQL version: a.b.c'
© Copyright 2015 Compose, Zalando SE