File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -26,22 +26,18 @@ def getinfo(conn):
26
26
if not cur .fetchone ():
27
27
raise SystemExit ("pg_statviz extension is not installed in this "
28
28
+ "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
33
33
FROM _info""" )
34
- info ['hostname' ], info ['inet_server_addr' ], info ['block_size' ] \
35
- = cur .fetchone ()
34
+ info ['hostname' ] = cur .fetchone ()
36
35
cur .close ()
37
36
except (ExternalRoutineException , InsufficientPrivilege ) as e :
38
37
conn .rollback ()
39
38
cur = conn .cursor ()
40
39
_logger .warning ("Context: getting hostname" )
41
40
_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 ()
45
41
info ['hostname' ] = conn .info .host
46
42
_logger .info (f"""Setting hostname to "{ info ['hostname' ]} " """ )
47
43
cur .close ()
You can’t perform that action at this time.
0 commit comments