Skip to content

Commit

Permalink
update postgres.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Bayr committed Jul 3, 2024
1 parent 32c5df6 commit acb4e41
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions sddi-urban/tmp/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -1704,26 +1704,26 @@ def _read_connection_has_correct_privileges(self):

write_connection.execute(drop_foo_sql)

print('MB----you are right here')
self._log_or_raise('MB----you are right here')

try:
write_connection.execute(u'CREATE TEMP TABLE _foo ()')
for privilege in ['INSERT', 'UPDATE', 'DELETE']:
print(privilege)
print('-------------')
self._log_or_raise(privilege)
self._log_or_raise('-------------')
privilege_sql = u"SELECT has_table_privilege(%s, '_foo', %s)"
print(privilege_sql)
print('-------------')
self._log_or_raise(privilege_sql)
self._log_or_raise('-------------')
have_privilege = write_connection.execute(
privilege_sql,
(read_connection_user, privilege)
).first()[0]
print(have_privilege)
print('-------------')
self._log_or_raise(have_privilege)
self._log_or_raise('-------------')
if have_privilege:
print('false')
self._log_or_raise('false')
return False
print('----------------------')
self._log_or_raise('----------------------XXX')
finally:
write_connection.execute(drop_foo_sql)
write_connection.close()
Expand Down

0 comments on commit acb4e41

Please sign in to comment.