From 34aa98a99cb5a0c0b966f54927cfc3a4cbe08bcc Mon Sep 17 00:00:00 2001 From: Johannes Steger Date: Mon, 26 Jan 2015 14:04:53 +0100 Subject: [PATCH] Fix function identifier quoting --- database/postgresql/postgresql_privs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/database/postgresql/postgresql_privs.py b/database/postgresql/postgresql_privs.py index 9b9d94923bc..22a565f6b65 100644 --- a/database/postgresql/postgresql_privs.py +++ b/database/postgresql/postgresql_privs.py @@ -474,10 +474,13 @@ class Connection(object): if obj_type == 'group': set_what = ','.join(pg_quote_identifier(i, 'role') for i in obj_ids) else: + # function types are already quoted above + if obj_type != 'function': + obj_ids = [pg_quote_identifier(i, 'table') for i in obj_ids] # Note: obj_type has been checked against a set of string literals # and privs was escaped when it was parsed set_what = '%s ON %s %s' % (','.join(privs), obj_type, - ','.join(pg_quote_identifier(i, 'table') for i in obj_ids)) + ','.join(obj_ids)) # for_whom: SQL-fragment specifying for whom to set the above if roles == 'PUBLIC':