mirror of
https://github.com/odoo/runbot.git
synced 2025-03-16 07:55:45 +07:00
[FIX] runbot: correct pg version detection
`local_cr` is directly a psycopg cursor, not an odoo one.
This commit is contained in:
parent
5697f1ab9c
commit
338166e474
@ -612,7 +612,7 @@ class runbot_build(models.Model):
|
||||
|
||||
def _local_pg_dropdb(self, dbname):
|
||||
with local_pgadmin_cursor() as local_cr:
|
||||
pid_col = 'pid' if local_cr._cnx.server_version >= 90200 else 'procpid'
|
||||
pid_col = 'pid' if local_cr.connection.server_version >= 90200 else 'procpid'
|
||||
query = 'SELECT pg_terminate_backend({}) FROM pg_stat_activity WHERE datname=%s'.format(pid_col)
|
||||
local_cr.execute(query, [dbname])
|
||||
local_cr.execute('DROP DATABASE IF EXISTS "%s"' % dbname)
|
||||
|
Loading…
Reference in New Issue
Block a user