Fix a number of minor issues with catalog objects:

- Remove unnecessary columns from collection property lists.
- Standardise property names and groupings.
- pg_attribute doesn't have an OID column, so use attnum instead (of atttypid!?!)
This commit is contained in:
Dave Page 2016-03-11 10:09:23 +00:00
parent 470881ac46
commit c0086b092f
5 changed files with 12 additions and 14 deletions

View File

@ -217,7 +217,7 @@ class CatalogObjectColumnsView(PGChildNodeView):
for row in rset['rows']:
res.append(
self.blueprint.generate_browser_node(
row['atttypid'],
row['attnum'],
coid,
row['attname'],
icon="icon-catalog_object_column"
@ -239,7 +239,6 @@ class CatalogObjectColumnsView(PGChildNodeView):
sid: Server ID
did: Database ID
scid: Schema ID
scid: Schema ID
coid: Catalog object ID
clid: Column ID

View File

@ -7,7 +7,8 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
pgAdmin.Browser.Collection.extend({
node: 'catalog_object_column',
label: '{{ _('catalog_object_column') }}',
type: 'coll-catalog_object_column'
type: 'coll-catalog_object_column',
columns: ['attname', 'attnum', 'cltype', 'description']
});
};
@ -41,9 +42,6 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
schema: [{
id: 'attname', label: '{{ _('Column') }}', cell: 'string',
type: 'text', disabled: true
},{
id: 'atttypid', label: '{{ _('Oid') }}', cell: 'string',
type: 'text', disabled: true
},{
id: 'attowner', label: '{{ _('Owner') }}', cell: 'string',
type: 'text', disabled: true
@ -52,13 +50,13 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
type: 'text', disabled: true
},{
id: 'cltype', label:'{{ _('Data type') }}', cell: 'string',
type: 'text', disabled: true
group: '{{ _('Definition') }}', type: 'text', disabled: true
},{
id: 'collspcname', label:'{{ _('Collation') }}', cell: 'string',
type: 'text', disabled: true
group: '{{ _('Definition') }}', type: 'text', disabled: true
},{
id: 'attacl', label:'{{ _('ACL') }}', cell: 'string',
type: 'text', disabled: true
id: 'attacl', label:'{{ _('Privileges') }}', cell: 'string',
group: '{{ _('Security') }}', type: 'text', disabled: true
},{
id: 'description', label:'{{ _('Comment') }}', cell: 'string',
type: 'multiline', disabled: true

View File

@ -1,5 +1,5 @@
SELECT
atttypid, attname
attnum, attname
FROM pg_attribute att
WHERE att.attrelid = {{coid}}::oid
AND att.attnum > 0

View File

@ -34,7 +34,7 @@ FROM pg_attribute att
LEFT OUTER JOIN pg_collation coll ON att.attcollation=coll.oid
LEFT OUTER JOIN pg_namespace nspc ON coll.collnamespace=nspc.oid
WHERE att.attrelid = {{coid}}::oid{% if clid %}
AND att.atttypid = {{clid}}::oid
AND att.attnum = {{clid}}::int
{% endif %}
AND att.attnum > 0
AND att.attisdropped IS FALSE

View File

@ -7,7 +7,8 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
pgAdmin.Browser.Collection.extend({
node: 'catalog_object',
label: '{{ _('Catalog Objects') }}',
type: 'coll-catalog_object'
type: 'coll-catalog_object',
columns: ['name', 'owner', 'description']
});
};
@ -37,7 +38,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
id: 'name', label: '{{ _('Name') }}', cell: 'string',
type: 'text', disabled: true
},{
id: 'oid', label:'{{ _('Oid') }}', cell: 'string',
id: 'oid', label:'{{ _('OID') }}', cell: 'string',
type: 'text', disabled: true
},{
id: 'owner', label:'{{ _('Owner') }}', cell: 'string',