Skip to content

Commit d488f17

Browse files
committed
Added support for DB Proxies (e.g. pgbouncer)
1 parent ffd4edf commit d488f17

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/pgbouncer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ def connect_to_postgres() -> psycopg2:
2222

2323
def create_database(con: psycopg2):
2424
with con.cursor() as cur:
25-
cur.execute("CREATE TABLE IF NOT EXISTS pg_shadow (usename text, passwd text);")
25+
cur.execute("CREATE TABLE IF NOT EXISTS pgbouncer_shadow (usename text, passwd text);")
2626

2727

2828
def insert_db_username(con: psycopg2, db_username: str, db_password: str):
2929
with con.cursor() as cur:
30-
cur.execute("INSERT INTO pg_shadow VALUES (%s, %s);", (db_username, db_password))
30+
cur.execute("INSERT INTO pgbouncer_shadow VALUES (%s, %s);", (db_username, db_password))
3131

3232

3333
def remove_db_username(con: psycopg2, db_username: str):
3434
with con.cursor() as cur:
35-
cur.execute("DELETE FROM pg_shadow WHERE usename=%s;", (db_username,))
35+
cur.execute("DELETE FROM pgbouncer_shadow WHERE usename=%s;", (db_username,))

0 commit comments

Comments
 (0)