Fix reverse engineering SQL issue for partitions when specifying digits as comments. Fixes #4893.
parent
6c7fe644e5
commit
f8e1973bc2
|
@ -34,6 +34,7 @@ Bug fixes
|
||||||
| `Issue #4818 <https://redmine.postgresql.org/issues/4818>`_ - Fix server connection drops out issue in query tool.
|
| `Issue #4818 <https://redmine.postgresql.org/issues/4818>`_ - Fix server connection drops out issue in query tool.
|
||||||
| `Issue #4836 <https://redmine.postgresql.org/issues/4836>`_ - Updated the json file name from 'servers.json' to 'pgadmin4/servers.json' in the container deployment section of the documentation.
|
| `Issue #4836 <https://redmine.postgresql.org/issues/4836>`_ - Updated the json file name from 'servers.json' to 'pgadmin4/servers.json' in the container deployment section of the documentation.
|
||||||
| `Issue #4878 <https://redmine.postgresql.org/issues/4878>`_ - Ensure that the superuser should be able to create role, as the superuser overrides all the access restrictions.
|
| `Issue #4878 <https://redmine.postgresql.org/issues/4878>`_ - Ensure that the superuser should be able to create role, as the superuser overrides all the access restrictions.
|
||||||
|
| `Issue #4893 <https://redmine.postgresql.org/issues/4893>`_ - Fix reverse engineering SQL issue for partitions when specifying digits as comments.
|
||||||
| `Issue #4923 <https://redmine.postgresql.org/issues/4923>`_ - Enhance the logic to change the label from 'Delete/Drop' to 'Remove' for the server and server group node.
|
| `Issue #4923 <https://redmine.postgresql.org/issues/4923>`_ - Enhance the logic to change the label from 'Delete/Drop' to 'Remove' for the server and server group node.
|
||||||
| `Issue #4925 <https://redmine.postgresql.org/issues/4925>`_ - Shown some text on process watcher till the initial logs are loaded.
|
| `Issue #4925 <https://redmine.postgresql.org/issues/4925>`_ - Shown some text on process watcher till the initial logs are loaded.
|
||||||
| `Issue #4926 <https://redmine.postgresql.org/issues/4926>`_ - Fix VPN network disconnect issue where pgAdmin4 hangs on expanding the Servers node.
|
| `Issue #4926 <https://redmine.postgresql.org/issues/4926>`_ - Fix VPN network disconnect issue where pgAdmin4 hangs on expanding the Servers node.
|
||||||
|
|
|
@ -501,6 +501,11 @@ class PartitionsView(BaseTableView, DataTypeReader, VacuumSettings):
|
||||||
data = dict()
|
data = dict()
|
||||||
for k, v in request.args.items():
|
for k, v in request.args.items():
|
||||||
try:
|
try:
|
||||||
|
# comments should be taken as is because if user enters a
|
||||||
|
# json comment it is parsed by loads which should not happen
|
||||||
|
if k in ('description',):
|
||||||
|
data[k] = v
|
||||||
|
else:
|
||||||
data[k] = json.loads(v, encoding='utf-8')
|
data[k] = json.loads(v, encoding='utf-8')
|
||||||
except (ValueError, TypeError, KeyError):
|
except (ValueError, TypeError, KeyError):
|
||||||
data[k] = v
|
data[k] = v
|
||||||
|
@ -543,6 +548,11 @@ class PartitionsView(BaseTableView, DataTypeReader, VacuumSettings):
|
||||||
|
|
||||||
for k, v in data.items():
|
for k, v in data.items():
|
||||||
try:
|
try:
|
||||||
|
# comments should be taken as is because if user enters a
|
||||||
|
# json comment it is parsed by loads which should not happen
|
||||||
|
if k in ('description',):
|
||||||
|
data[k] = v
|
||||||
|
else:
|
||||||
data[k] = json.loads(v, encoding='utf-8')
|
data[k] = json.loads(v, encoding='utf-8')
|
||||||
except (ValueError, TypeError, KeyError):
|
except (ValueError, TypeError, KeyError):
|
||||||
data[k] = v
|
data[k] = v
|
||||||
|
|
|
@ -15,6 +15,8 @@ from pgadmin.utils.ajax import internal_server_error
|
||||||
from pgadmin.utils.exception import ObjectGone
|
from pgadmin.utils.exception import ObjectGone
|
||||||
from pgadmin.browser.server_groups.servers.databases.schemas.utils \
|
from pgadmin.browser.server_groups.servers.databases.schemas.utils \
|
||||||
import trigger_definition
|
import trigger_definition
|
||||||
|
from config import PG_DEFAULT_DRIVER
|
||||||
|
from pgadmin.utils.driver import get_driver
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,9 +123,10 @@ def get_trigger_function_and_columns(conn, data, tid,
|
||||||
data['tfunction'] = result['rows'][0]['tfunctions']
|
data['tfunction'] = result['rows'][0]['tfunctions']
|
||||||
|
|
||||||
if len(data['custom_tgargs']) > 0:
|
if len(data['custom_tgargs']) > 0:
|
||||||
|
driver = get_driver(PG_DEFAULT_DRIVER)
|
||||||
# We know that trigger has more than 1 argument, let's join them
|
# We know that trigger has more than 1 argument, let's join them
|
||||||
# and convert it to string
|
# and convert it to string
|
||||||
formatted_args = ["'{0}'".format(arg)
|
formatted_args = [driver.qtLiteral(arg)
|
||||||
for arg in data['custom_tgargs']]
|
for arg in data['custom_tgargs']]
|
||||||
formatted_args = ', '.join(formatted_args)
|
formatted_args = ', '.join(formatted_args)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue