Skip to content

Commit 4500ae9

Browse files
author
Marcin Godzina
committed
[#3418] remove os check before Postgres ddb grant
1 parent 0186cbb commit 4500ae9

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

Diff for: hammer.py

+6-9
Original file line numberDiff line numberDiff line change
@@ -1555,15 +1555,12 @@ def _configure_pgsql(system, revision, features):
15551555
cmd += 'EOF\n"'
15561556
execute(cmd, cwd='/tmp')
15571557

1558-
if system == 'fedora' and int(revision) >= 38 or \
1559-
system == 'debian' and int(revision) >= 12 or \
1560-
system == 'alpine' and float(revision) >= 3.17:
1561-
#TODO it needs detection of pgsql version, and apply this only for postgres >= 15
1562-
cmd = """bash -c \"cat <<EOF | sudo -u postgres psql postgres
1563-
GRANT ALL ON DATABASE keatest TO keatest;
1564-
ALTER DATABASE keatest OWNER TO keatest;\n"""
1565-
cmd += 'EOF\n"'
1566-
execute(cmd, cwd='/tmp')
1558+
# This is needed for postgres >= 15
1559+
cmd = """bash -c \"cat <<EOF | sudo -u postgres psql postgres
1560+
GRANT ALL ON DATABASE keatest TO keatest;
1561+
ALTER DATABASE keatest OWNER TO keatest;\n"""
1562+
cmd += 'EOF\n"'
1563+
execute(cmd, cwd='/tmp')
15671564

15681565
cmd = """bash -c \"cat <<EOF | sudo -u postgres psql -U keatest keatest
15691566
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO keatest_readonly;\n"""

0 commit comments

Comments
 (0)