mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-08-09 12:38:35 -05:00
Fix quoting of index column names on tables. Fixes #2619
This commit is contained in:
committed by
Dave Page
parent
d5f60e1a47
commit
8d248dab4c
+5
-3
@@ -480,7 +480,7 @@ class IndexesView(PGChildNodeView):
|
||||
status=200
|
||||
)
|
||||
|
||||
def _column_details(self, idx, data):
|
||||
def _column_details(self, idx, data, mode='properties'):
|
||||
"""
|
||||
This functional will fetch list of column details for index
|
||||
|
||||
@@ -504,8 +504,10 @@ class IndexesView(PGChildNodeView):
|
||||
cols = []
|
||||
for row in rset['rows']:
|
||||
# We need all data as collection for ColumnsModel
|
||||
# we will not strip down colname when using in SQL to display
|
||||
cols_data = {
|
||||
'colname': row['attdef'].strip('"'),
|
||||
'colname': row['attdef'] if mode == 'create' else
|
||||
row['attdef'].strip('"'),
|
||||
'collspcname': row['collnspname'],
|
||||
'op_class': row['opcname'],
|
||||
}
|
||||
@@ -901,7 +903,7 @@ class IndexesView(PGChildNodeView):
|
||||
data['table'] = self.table
|
||||
|
||||
# Add column details for current index
|
||||
data = self._column_details(idx, data)
|
||||
data = self._column_details(idx, data, 'create')
|
||||
|
||||
SQL, name = self.get_sql(did, scid, tid, None, data)
|
||||
if not isinstance(SQL, (str, unicode)):
|
||||
|
||||
@@ -923,8 +923,9 @@ class BaseTableView(PGChildNodeView):
|
||||
cols = []
|
||||
for col_row in rset['rows']:
|
||||
# We need all data as collection for ColumnsModel
|
||||
# Only for displaying SQL, we can omit strip on colname
|
||||
cols_data = {
|
||||
'colname': col_row['attdef'].strip('"'),
|
||||
'colname': col_row['attdef'],
|
||||
'collspcname': col_row['collnspname'],
|
||||
'op_class': col_row['opcname'],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user