mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure columns with types that are not in pg_catalog are handled properly in the table dialog.
This commit is contained in:
parent
d05534ad6c
commit
01b2288d57
@ -2247,9 +2247,6 @@ class TableView(PGChildNodeView, DataTypeReader, VacuumSettings):
|
||||
if isArray:
|
||||
old_data['cltype'] += "[]"
|
||||
|
||||
if old_data['typnspname'] != 'pg_catalog':
|
||||
old_data['cltype'] = self.qtIdent(self.conn, old_data['typnspname']) \
|
||||
+ '.' + old_data['cltype']
|
||||
# Sql for alter column
|
||||
if 'inheritedfrom' not in c:
|
||||
column_sql += render_template("/".join(
|
||||
|
@ -381,7 +381,7 @@ function($, _, S, pgAdmin, pgBrowser, Backform, alertify) {
|
||||
|
||||
!flag && setTimeout(function() {
|
||||
if(m.get('attlen')) {
|
||||
m.set('attlen', null);
|
||||
m.set('attlen', null, {silent: true});
|
||||
}
|
||||
},10);
|
||||
|
||||
|
@ -10,7 +10,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
|
||||
{### Alter column type and collation ###}
|
||||
{% if (data.cltype and data.cltype != o_data.cltype) or (data.attlen and data.attlen != o_data.attlen) or (data.attprecision or data.attprecision != o_data.attprecision) %}
|
||||
ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
|
||||
ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} TYPE {% if data.cltype %}{{conn|qtTypeIdent(data.cltype)}} {% else %}{{conn|qtTypeIdent(o_data.cltype)}} {% endif %}
|
||||
ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} TYPE {% if data.cltype %}{{conn|qtTypeIdent(data.cltype)}} {% elif o_data.typnspname != 'pg_catalog' %}{{conn|qtTypeIdent(o_data.typnspname, o_data.cltype)}}{% else %}{{conn|qtTypeIdent(o_data.cltype)}} {% endif %}
|
||||
{% if data.attlen and data.attlen != 'None' %}({{data.attlen}}{% if data.attlen != 'None' and data.attprecision %}, {{data.attprecision}}){% elif (data.cltype is defined and not data.cltype) %}, {{o_data.attprecision}}){% elif data.attlen %}){% endif %}{% endif %}{% if data.hasSqrBracket %}
|
||||
[]{% endif %}{% if data.collspcname and data.collspcname != o_data.collspcname %}
|
||||
COLLATE {{data.collspcname}}{% endif %};
|
||||
|
@ -10,7 +10,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
|
||||
{### Alter column type and collation ###}
|
||||
{% if (data.cltype and data.cltype != o_data.cltype) or (data.attlen and data.attlen != o_data.attlen) or (data.attprecision or data.attprecision != o_data.attprecision) %}
|
||||
ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
|
||||
ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} TYPE {% if data.cltype %}{{conn|qtTypeIdent(data.cltype)}} {% else %}{{conn|qtTypeIdent(o_data.cltype)}} {% endif %}
|
||||
ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} TYPE {% if data.cltype %}{{conn|qtTypeIdent(data.cltype)}} {% elif o_data.typnspname != 'pg_catalog' %}{{conn|qtTypeIdent(o_data.typnspname, o_data.cltype)}}{% else %}{{conn|qtTypeIdent(o_data.cltype)}} {% endif %}
|
||||
{% if data.attlen and data.attlen != 'None' %}({{data.attlen}}{% if data.attlen != 'None' and data.attprecision %}, {{data.attprecision}}){% elif (data.cltype is defined and not data.cltype) %}, {{o_data.attprecision}}){% elif data.attlen %}){% endif %}{% endif %}{% if data.hasSqrBracket %}
|
||||
[]{% endif %}{% if data.collspcname and data.collspcname != o_data.collspcname %}
|
||||
COLLATE {{data.collspcname}}{% endif %};
|
||||
|
Loading…
Reference in New Issue
Block a user