Don't quote variable values used by SET. It's usually going to be wrong. Fixes #3027

This commit is contained in:
Dave Page 2018-02-02 14:58:29 +01:00
parent 262d01bf01
commit 4d69764869
2 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@
{% for opt in options %} {% for opt in options %}
ALTER {{object_type}} {{ conn|qtIdent(schema, object_name) }}({{func_args}}) ALTER {{object_type}} {{ conn|qtIdent(schema, object_name) }}({{func_args}})
SET {{ conn|qtIdent(opt.name) }}={{ opt.value|qtLiteral }}; SET {{ conn|qtIdent(opt.name) }}={{ opt.value }};
{% endfor %} {% endfor %}
{%- endmacro %} {%- endmacro %}

View File

@ -4,7 +4,7 @@
{% macro APPLY(conn, database, role, param, value) -%} {% macro APPLY(conn, database, role, param, value) -%}
ALTER {% if role %}ROLE {{ self.conn|qtIdent(role) }}{% if database %} IN DATABASE {{ conn|qtIdent(database) }}{% endif %}{% else %}DATABASE {{ conn|qtIdent(database) }}{% endif %} ALTER {% if role %}ROLE {{ self.conn|qtIdent(role) }}{% if database %} IN DATABASE {{ conn|qtIdent(database) }}{% endif %}{% else %}DATABASE {{ conn|qtIdent(database) }}{% endif %}
SET {{ conn|qtIdent(param) }} TO {{ value|qtLiteral }}; SET {{ conn|qtIdent(param) }} TO {{ value }};
{%- endmacro %} {%- endmacro %}
{% macro RESET(conn, database, role, param) -%} {% macro RESET(conn, database, role, param) -%}
ALTER {% if role %}ROLE {{ self.conn|qtIdent(role) }}{% if database %} IN DATABASE {{ conn|qtIdent(database) }}{% endif %}{% else %}DATABASE {{ conn|qtIdent(database) }}{% endif %} ALTER {% if role %}ROLE {{ self.conn|qtIdent(role) }}{% if database %} IN DATABASE {{ conn|qtIdent(database) }}{% endif %}{% else %}DATABASE {{ conn|qtIdent(database) }}{% endif %}
@ -18,7 +18,7 @@ ALTER {% if role %}ROLE {{ self.conn|qtIdent(role) }}{% if database %} IN DATABA
ALTER {{object_type}} {{ conn|qtIdent(object_name) }} ALTER {{object_type}} {{ conn|qtIdent(object_name) }}
SET ({% for opt in options %}{% if loop.index != 1 %} SET ({% for opt in options %}{% if loop.index != 1 %}
, {% endif %}{{ conn|qtIdent(opt.name) }}={{ opt.value|qtLiteral }}{% endfor %}); , {% endif %}{{ conn|qtIdent(opt.name) }}={{ opt.value }}{% endfor %});
{%- endmacro %} {%- endmacro %}
{% macro UNSET(conn, object_type, object_name, options) -%} {% macro UNSET(conn, object_type, object_name, options) -%}
ALTER {{object_type}} {{ conn|qtIdent(object_name) }} ALTER {{object_type}} {{ conn|qtIdent(object_name) }}