Fix ordering of VACUUM options which changed in PG11. Fixes #3836

While we're at it, fix the JSON handling in the maintenance/backup/restore routes.
This commit is contained in:
Akshay Joshi 2019-01-10 15:29:55 +05:30 committed by Dave Page
parent a8167f0a72
commit 8fb340d23b
5 changed files with 5 additions and 10 deletions

View File

@ -15,5 +15,6 @@ Bug fixes
*********
| `Bug #3575 <https://redmine.postgresql.org/issues/3575>`_ - Ensure the context menu works after a server is renamed.
| `Bug #3836 <https://redmine.postgresql.org/issues/3836>`_ - Fix ordering of VACUUM options which changed in PG11.
| `Bug #3842 <https://redmine.postgresql.org/issues/3842>`_ - Don't show system catalogs in the schemas property list unless show system objects is enabled.
| `Bug #3861 <https://redmine.postgresql.org/issues/3861>`_ - Fix help for the backup/restore dialogues.

View File

@ -276,9 +276,7 @@ def create_backup_objects_job(sid):
None
"""
if request.form:
# Convert ImmutableDict to dict
data = dict(request.form)
data = json.loads(data['data'][0], encoding='utf-8')
data = json.loads(request.form['data'], encoding='utf-8')
else:
data = json.loads(request.data, encoding='utf-8')

View File

@ -174,9 +174,7 @@ def create_maintenance_job(sid, did):
None
"""
if request.form:
# Convert ImmutableDict to dict
data = dict(request.form)
data = json.loads(data['data'][0], encoding='utf-8')
data = json.loads(request.form['data'], encoding='utf-8')
else:
data = json.loads(request.data, encoding='utf-8')

View File

@ -1,5 +1,5 @@
{% if data.op == "VACUUM" %}
VACUUM{% if data.vacuum_full %} FULL{% endif %}{% if data.vacuum_freeze %} FREEZE{% endif %}{% if data.vacuum_analyze %} ANALYZE{% endif %}{% if data.verbose %} VERBOSE{% endif %}{% if data.schema %} {{ conn|qtIdent(data.schema) }}.{{ conn|qtIdent(data.table) }}{% endif %};
VACUUM{% if data.vacuum_full %} FULL{% endif %}{% if data.vacuum_freeze %} FREEZE{% endif %}{% if data.verbose %} VERBOSE{% endif %}{% if data.vacuum_analyze %} ANALYZE{% endif %}{% if data.schema %} {{ conn|qtIdent(data.schema) }}.{{ conn|qtIdent(data.table) }}{% endif %};
{% endif %}
{% if data.op == "ANALYZE" %}
ANALYZE{% if data.verbose %} VERBOSE{% endif %}{% if data.schema %} {{ conn|qtIdent(data.schema, data.table) }}{% endif %};

View File

@ -183,9 +183,7 @@ def create_restore_job(sid):
None
"""
if request.form:
# Convert ImmutableDict to dict
data = dict(request.form)
data = json.loads(data['data'][0], encoding='utf-8')
data = json.loads(request.form['data'], encoding='utf-8')
else:
data = json.loads(request.data, encoding='utf-8')