Unable to add/update variables for columns of a table. Fixes #2659

This commit is contained in:
Akshay Joshi
2017-08-23 17:11:30 +05:30
parent ee20a10e94
commit fe6e4686a2
2 changed files with 10 additions and 9 deletions

View File

@@ -16,6 +16,7 @@ define('pgadmin.node.column', [
// This Node model will be used for variable control for column
var VariablesModel = Backform.VariablesModel = pgBrowser.Node.Model.extend({
idAttribute: 'name',
defaults: {
name: null,
value: null

View File

@@ -161,7 +161,7 @@ class BaseTableView(PGChildNodeView):
status, result = self.conn.execute_dict(SQL)
if not status:
return internal_server_error(errormsg=res)
return internal_server_error(errormsg=result)
# Update the trigger function which we have fetched with
# schema name
@@ -1680,27 +1680,27 @@ class BaseTableView(PGChildNodeView):
length = False
precision = False
if 'elemoid' in column:
if 'elemoid' in c:
length, precision, typeval = \
self.get_length_precision(column['elemoid'])
self.get_length_precision(c['elemoid'])
# Set length and precision to None
column['attlen'] = None
column['attprecision'] = None
c['attlen'] = None
c['attprecision'] = None
# If we have length & precision both
if length and precision:
matchObj = re.search(r'(\d+),(\d+)', fulltype)
if matchObj:
column['attlen'] = matchObj.group(1)
column['attprecision'] = matchObj.group(2)
c['attlen'] = matchObj.group(1)
c['attprecision'] = matchObj.group(2)
elif length:
# If we have length only
matchObj = re.search(r'(\d+)', fulltype)
if matchObj:
column['attlen'] = matchObj.group(1)
column['attprecision'] = None
c['attlen'] = matchObj.group(1)
c['attprecision'] = None
old_data['cltype'] = DataTypeReader.parse_type_name(
old_data['cltype']