mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fix handling of "char" columns. Fixes #2152
This commit is contained in:
parent
4d8683e13a
commit
c96da34c28
@ -490,6 +490,15 @@ class ColumnsView(PGChildNodeView, DataTypeReader):
|
|||||||
after length/precision so we will set flag for
|
after length/precision so we will set flag for
|
||||||
sql template
|
sql template
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# We need to add this exceptional case for manually adding " in type
|
||||||
|
# in json.loads('"char"') is valid json hence it
|
||||||
|
# converts '"char"' -> 'char' as string but if we
|
||||||
|
# send the same in collection json.loads() handles it properly in
|
||||||
|
# Table & Type nodes, This handling handling is Column node specific
|
||||||
|
if type == 'char':
|
||||||
|
type = '"char"'
|
||||||
|
|
||||||
if '[]' in type:
|
if '[]' in type:
|
||||||
type = type.replace('[]', '')
|
type = type.replace('[]', '')
|
||||||
self.hasSqrBracket = True
|
self.hasSqrBracket = True
|
||||||
@ -710,7 +719,7 @@ class ColumnsView(PGChildNodeView, DataTypeReader):
|
|||||||
for k, v in request.args.items():
|
for k, v in request.args.items():
|
||||||
try:
|
try:
|
||||||
data[k] = json.loads(v, encoding='utf-8')
|
data[k] = json.loads(v, encoding='utf-8')
|
||||||
except ValueError:
|
except (ValueError, TypeError, KeyError):
|
||||||
data[k] = v
|
data[k] = v
|
||||||
|
|
||||||
# Adding parent into data dict, will be using it while creating sql
|
# Adding parent into data dict, will be using it while creating sql
|
||||||
|
Loading…
Reference in New Issue
Block a user