Permalink
Browse files

some cleanup and bug fixes

  • Loading branch information...
erichanson committed Feb 8, 2019
1 parent cc7f5ec commit fa961dc54bac95a50fc8477f60723efef20c950f
@@ -16,15 +16,6 @@ create extension bundle;
------------------------------------------------------------------------
set search_path=bundle;

-- bundle internal tables
insert into bundle.ignored_relation(relation_id) values (meta.relation_id('bundle','bundle'));
insert into bundle.ignored_relation(relation_id) values (meta.relation_id('bundle','commit'));
insert into bundle.ignored_relation(relation_id) values (meta.relation_id('bundle','rowset'));
insert into bundle.ignored_relation(relation_id) values (meta.relation_id('bundle','rowset_row'));
insert into bundle.ignored_relation(relation_id) values (meta.relation_id('bundle','rowset_row_field'));
insert into bundle.ignored_relation(relation_id) values (meta.relation_id('bundle','blob'));
insert into bundle.ignored_relation(relation_id) values (meta.relation_id('bundle','tracked_row_added'));

insert into bundle.bundle (name) values ('org.aquameta.core.bundle');

-- TODO: track the ignored_rows
@@ -596,13 +596,16 @@ select *, 'select meta.row_id(' ||
' where id not in (select relation_id from bundle.ignored_relation) and schema_id not in (select schema_id from bundle.ignored_schema)'
-- functions
when (r.schema_id).name = 'meta' and ((r.relation_id).name) = 'function_definition' then
' where schema_id not in (select schema_id from bundle.ignored_schema)'
' where id::meta.schema_id not in (select schema_id from bundle.ignored_schema)'
-- columns
when (r.schema_id).name = 'meta' and ((r.relation_id).name) = 'column' then
' where id not in (select column_id from bundle.ignored_column) and id::meta.relation_id not in (select relation_id from bundle.ignored_relation) and id::meta.schema_id not in (select schema_id from bundle.ignored_schema)'
-- objects that exist in schema scope
when (r.schema_id).name = 'meta' and ((r.relation_id).name) in ('type_definition', 'operator') then
when (r.schema_id).name = 'meta' and ((r.relation_id).name) in ('operator') then
' where meta.schema_id(schema_name) not in (select schema_id from bundle.ignored_schema)'
-- objects that exist in schema scope
when (r.schema_id).name = 'meta' and ((r.relation_id).name) in ('type_definition') then
' where id::meta.schema_id not in (select schema_id from bundle.ignored_schema)'
-- objects that exist in table scope
when (r.schema_id).name = 'meta' and ((r.relation_id).name) in ('constraint_check','constraint_unique','table_privilege') then
' where meta.schema_id(schema_name) not in (select schema_id from bundle.ignored_schema) and table_id not in (select relation_id from bundle.ignored_relation)'
@@ -0,0 +1,11 @@
insert into bundle.ignored_relation(relation_id) values (meta.relation_id('bundle','bundle'));
insert into bundle.ignored_relation(relation_id) values (meta.relation_id('bundle','commit'));
insert into bundle.ignored_relation(relation_id) values (meta.relation_id('bundle','rowset'));
insert into bundle.ignored_relation(relation_id) values (meta.relation_id('bundle','rowset_row'));
insert into bundle.ignored_relation(relation_id) values (meta.relation_id('bundle','rowset_row_field'));
insert into bundle.ignored_relation(relation_id) values (meta.relation_id('bundle','blob'));
insert into bundle.ignored_relation(relation_id) values (meta.relation_id('bundle','tracked_row_added'));

insert into bundle.ignored_schema(schema_id) values (meta.schema_id('pg_catalog'));
insert into bundle.ignored_schema(schema_id) values (meta.schema_id('public'));
insert into bundle.ignored_schema(schema_id) values (meta.schema_id('information_schema'));
@@ -17,8 +17,8 @@ insert into bundle.trackable_nontable_relation (pk_column_id) values
(meta.column_id('meta','operator','id')),
-- (meta.column_id('meta','policy','id')),
-- (meta.column_id('meta','policy_role','id')),
(meta.column_id('meta','relation','id')),
(meta.column_id('meta','relation_column','id')),
-- (meta.column_id('meta','relation','id')),
-- (meta.column_id('meta','relation_column','id')),
-- (meta.column_id('meta','role','id')),
-- (meta.column_id('meta','role_inheritance','id')),
(meta.column_id('meta','schema','id')),

0 comments on commit fa961dc

Please sign in to comment.