Skip to content

Commit f31a044

Browse files
committed
Update for psysopg 3, remove unused values from libs/info.py
1 parent 230080e commit f31a044

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/pg_statviz/libs/info.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,18 @@ def getinfo(conn):
2626
if not cur.fetchone():
2727
raise SystemExit("pg_statviz extension is not installed in this "
2828
+ "database")
29-
cur.execute("""CREATE TEMP TABLE _info(hostname text);
30-
COPY _info FROM PROGRAM 'hostname';
31-
SELECT hostname,
32-
inet_server_addr()
29+
cur.execute("""CREATE TEMP TABLE _info(hostname text)""")
30+
cur.execute("""COPY _info
31+
FROM PROGRAM 'hostname'""")
32+
cur.execute("""SELECT hostname
3333
FROM _info""")
34-
info['hostname'], info['inet_server_addr'], info['block_size'] \
35-
= cur.fetchone()
34+
info['hostname'] = cur.fetchone()
3635
cur.close()
3736
except (ExternalRoutineException, InsufficientPrivilege) as e:
3837
conn.rollback()
3938
cur = conn.cursor()
4039
_logger.warning("Context: getting hostname")
4140
_logger.warning(e)
42-
cur.execute("""SELECT inet_server_addr(),
43-
current_setting('block_size')""")
44-
info['inet_server_addr'], info['block_size'] = cur.fetchone()
4541
info['hostname'] = conn.info.host
4642
_logger.info(f"""Setting hostname to "{info['hostname']}" """)
4743
cur.close()

0 commit comments

Comments
 (0)