From eb1222729dbf419dd941043bb7ffd827c93e4eca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Mart=C3=ADnez?= Date: Thu, 21 Jan 2016 11:46:39 +0100 Subject: [PATCH] Remove ddl triggers specs --- Makefile | 3 +- expected/test_ddl_triggers.out | 199 --------------------------------- sql/test_ddl_triggers.sql | 102 ----------------- 3 files changed, 1 insertion(+), 303 deletions(-) delete mode 100644 expected/test_ddl_triggers.out delete mode 100644 sql/test_ddl_triggers.sql diff --git a/Makefile b/Makefile index eeb6c29..1f7eb2d 100644 --- a/Makefile +++ b/Makefile @@ -77,10 +77,9 @@ DATA_built = \ EXTRA_CLEAN = cartodb_version.sql DOCS = README.md -REGRESS_NEW = test_ddl_triggers REGRESS_OLD = $(wildcard test/*.sql) REGRESS_LEGACY = $(REGRESS_OLD:.sql=) -REGRESS = test_setup $(REGRESS_NEW) $(REGRESS_LEGACY) +REGRESS = test_setup $(REGRESS_LEGACY) PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) diff --git a/expected/test_ddl_triggers.out b/expected/test_ddl_triggers.out deleted file mode 100644 index 6746e61..0000000 --- a/expected/test_ddl_triggers.out +++ /dev/null @@ -1,199 +0,0 @@ -\set VERBOSITY terse --- Set user quota to infinite -SELECT CDB_SetUserQuotaInBytes(0); - cdb_setuserquotainbytes -------------------------- - 0 -(1 row) - --- Enable ddl triggers -SELECT cartodb.cdb_enable_ddl_hooks(); -NOTICE: event trigger "cdb_on_relation_create" does not exist, skipping -NOTICE: event trigger "cdb_on_relation_drop" does not exist, skipping -NOTICE: event trigger "cdb_on_alter_column" does not exist, skipping -NOTICE: event trigger "cdb_on_drop_column" does not exist, skipping -NOTICE: event trigger "cdb_on_add_column" does not exist, skipping - cdb_enable_ddl_hooks ----------------------- - -(1 row) - -create schema c; -SELECT CDB_SetUserQuotaInBytes('c', 0); - cdb_setuserquotainbytes -------------------------- - 0 -(1 row) - -DROP USER IF EXISTS cartodb_postgresql_unpriv_user; -NOTICE: role "cartodb_postgresql_unpriv_user" does not exist, skipping -CREATE USER cartodb_postgresql_unpriv_user; -GRANT ALL ON SCHEMA c to cartodb_postgresql_unpriv_user; -SET SESSION AUTHORIZATION 'cartodb_postgresql_unpriv_user'; ---SELECT session_user, current_user; ----------------------- --- CREATE TABLE ----------------------- -SET SESSION AUTHORIZATION 'cartodb_postgresql_unpriv_user'; -select 1 as i INTO c.t3; -NOTICE: trigger "track_updates" for table "c.t3" does not exist, skipping -NOTICE: trigger "update_the_geom_webmercator_trigger" for table "c.t3" does not exist, skipping -NOTICE: trigger "test_quota" for table "c.t3" does not exist, skipping -NOTICE: trigger "test_quota_per_row" for table "c.t3" does not exist, skipping -NOTICE: event trigger "cdb_on_relation_create" does not exist, skipping -NOTICE: event trigger "cdb_on_relation_drop" does not exist, skipping -NOTICE: event trigger "cdb_on_alter_column" does not exist, skipping -NOTICE: event trigger "cdb_on_drop_column" does not exist, skipping -NOTICE: event trigger "cdb_on_add_column" does not exist, skipping -NOTICE: cdb_invalidate_varnish(c.t3) called -RESET SESSION AUTHORIZATION; -select - tabname::text, - round(extract('secs' from now() - updated_at)) as age -FROM CDB_TableMetadata WHERE tabname = 'c.t3'::regclass; - tabname | age ----------+----- - c.t3 | 0 -(1 row) - -SET SESSION AUTHORIZATION 'cartodb_postgresql_unpriv_user'; --- Table with cartodb_id field, see --- http://github.com/CartoDB/cartodb-postgresql/issues/32 -select 1 as cartodb_id INTO c.t4; -NOTICE: trigger "track_updates" for table "c.t4" does not exist, skipping -NOTICE: trigger "update_the_geom_webmercator_trigger" for table "c.t4" does not exist, skipping -NOTICE: trigger "test_quota" for table "c.t4" does not exist, skipping -NOTICE: trigger "test_quota_per_row" for table "c.t4" does not exist, skipping -NOTICE: event trigger "cdb_on_relation_create" does not exist, skipping -NOTICE: event trigger "cdb_on_relation_drop" does not exist, skipping -NOTICE: event trigger "cdb_on_alter_column" does not exist, skipping -NOTICE: event trigger "cdb_on_drop_column" does not exist, skipping -NOTICE: event trigger "cdb_on_add_column" does not exist, skipping -NOTICE: cdb_invalidate_varnish(c.t4) called -RESET SESSION AUTHORIZATION; -select - tabname::text, - round(extract('secs' from now() - updated_at)) as age -FROM CDB_TableMetadata WHERE tabname = 'c.t4'::regclass; - tabname | age ----------+----- - c.t4 | 0 -(1 row) - ----------------------------- --- ALTER TABLE RENAME COLUMN ----------------------------- -SET SESSION AUTHORIZATION 'cartodb_postgresql_unpriv_user'; -select pg_sleep(.1); - pg_sleep ----------- - -(1 row) - -alter table c.t3 rename column the_geom_webmercator to webmerc; -NOTICE: column "the_geom_webmercator" of relation "t3" does not exist, skipping -NOTICE: event trigger "cdb_on_relation_create" does not exist, skipping -NOTICE: event trigger "cdb_on_relation_drop" does not exist, skipping -NOTICE: event trigger "cdb_on_alter_column" does not exist, skipping -NOTICE: event trigger "cdb_on_drop_column" does not exist, skipping -NOTICE: event trigger "cdb_on_add_column" does not exist, skipping -NOTICE: cdb_invalidate_varnish(c.t3) called -RESET SESSION AUTHORIZATION; -select - tabname::text, - round(extract('secs' from now() - updated_at)*10) as agecs -FROM CDB_TableMetadata WHERE tabname = 'c.t3'::regclass; - tabname | agecs ----------+------- - c.t3 | 0 -(1 row) - -SET SESSION AUTHORIZATION 'cartodb_postgresql_unpriv_user'; -select pg_sleep(.1); - pg_sleep ----------- - -(1 row) - -alter table c.t3 rename column the_geom_webmercator to webmerc2; -NOTICE: column "the_geom_webmercator" of relation "t3" does not exist, skipping -NOTICE: event trigger "cdb_on_relation_create" does not exist, skipping -NOTICE: event trigger "cdb_on_relation_drop" does not exist, skipping -NOTICE: event trigger "cdb_on_alter_column" does not exist, skipping -NOTICE: event trigger "cdb_on_drop_column" does not exist, skipping -NOTICE: event trigger "cdb_on_add_column" does not exist, skipping -NOTICE: cdb_invalidate_varnish(c.t3) called -RESET SESSION AUTHORIZATION; -select - tabname::text, - round(extract('secs' from now() - updated_at)*10) as agecs -FROM CDB_TableMetadata WHERE tabname = 'c.t3'::regclass; - tabname | agecs ----------+------- - c.t3 | 0 -(1 row) - ----------------------------- --- ALTER TABLE DROP COLUMN ----------------------------- -SET SESSION AUTHORIZATION 'cartodb_postgresql_unpriv_user'; -select pg_sleep(.1); - pg_sleep ----------- - -(1 row) - -alter table c.t3 drop column the_geom_webmercator; -NOTICE: event trigger "cdb_on_relation_create" does not exist, skipping -NOTICE: event trigger "cdb_on_relation_drop" does not exist, skipping -NOTICE: event trigger "cdb_on_alter_column" does not exist, skipping -NOTICE: event trigger "cdb_on_drop_column" does not exist, skipping -NOTICE: event trigger "cdb_on_add_column" does not exist, skipping -NOTICE: cdb_invalidate_varnish(c.t3) called -RESET SESSION AUTHORIZATION; -select - tabname::text, - round(extract('secs' from now() - updated_at)*10) as agecs -FROM CDB_TableMetadata WHERE tabname = 'c.t3'::regclass; - tabname | agecs ----------+------- - c.t3 | 0 -(1 row) - ----------------------------- --- ALTER TABLE ADD COLUMN ----------------------------- -SET SESSION AUTHORIZATION 'cartodb_postgresql_unpriv_user'; -select pg_sleep(.1); - pg_sleep ----------- - -(1 row) - -alter table c.t3 add column id2 int; -NOTICE: cdb_invalidate_varnish(c.t3) called -RESET SESSION AUTHORIZATION; -select - tabname::text, - round(extract('secs' from now() - updated_at)*10) as agecs -FROM CDB_TableMetadata WHERE tabname = 'c.t3'::regclass; - tabname | agecs ----------+------- - c.t3 | 0 -(1 row) - ----------------------------- --- DROP TABLE ----------------------------- -RESET SESSION AUTHORIZATION; -drop schema c cascade; -NOTICE: drop cascades to 3 other objects -select count(*) from CDB_TableMetadata; - count -------- - 0 -(1 row) - -DROP OWNED BY cartodb_postgresql_unpriv_user; -DROP ROLE cartodb_postgresql_unpriv_user; -DROP FUNCTION _CDB_UserQuotaInBytes(); diff --git a/sql/test_ddl_triggers.sql b/sql/test_ddl_triggers.sql deleted file mode 100644 index 6ed0d41..0000000 --- a/sql/test_ddl_triggers.sql +++ /dev/null @@ -1,102 +0,0 @@ -\set VERBOSITY terse - --- Set user quota to infinite -SELECT CDB_SetUserQuotaInBytes(0); - --- Enable ddl triggers -SELECT cartodb.cdb_enable_ddl_hooks(); - -create schema c; - -SELECT CDB_SetUserQuotaInBytes('c', 0); - -DROP USER IF EXISTS cartodb_postgresql_unpriv_user; -CREATE USER cartodb_postgresql_unpriv_user; -GRANT ALL ON SCHEMA c to cartodb_postgresql_unpriv_user; -SET SESSION AUTHORIZATION 'cartodb_postgresql_unpriv_user'; ---SELECT session_user, current_user; - ----------------------- --- CREATE TABLE ----------------------- -SET SESSION AUTHORIZATION 'cartodb_postgresql_unpriv_user'; -select 1 as i INTO c.t3; - -RESET SESSION AUTHORIZATION; -select - tabname::text, - round(extract('secs' from now() - updated_at)) as age -FROM CDB_TableMetadata WHERE tabname = 'c.t3'::regclass; - -SET SESSION AUTHORIZATION 'cartodb_postgresql_unpriv_user'; --- Table with cartodb_id field, see --- http://github.com/CartoDB/cartodb-postgresql/issues/32 -select 1 as cartodb_id INTO c.t4; - -RESET SESSION AUTHORIZATION; -select - tabname::text, - round(extract('secs' from now() - updated_at)) as age -FROM CDB_TableMetadata WHERE tabname = 'c.t4'::regclass; - ----------------------------- --- ALTER TABLE RENAME COLUMN ----------------------------- -SET SESSION AUTHORIZATION 'cartodb_postgresql_unpriv_user'; - -select pg_sleep(.1); -alter table c.t3 rename column the_geom_webmercator to webmerc; - -RESET SESSION AUTHORIZATION; -select - tabname::text, - round(extract('secs' from now() - updated_at)*10) as agecs -FROM CDB_TableMetadata WHERE tabname = 'c.t3'::regclass; - -SET SESSION AUTHORIZATION 'cartodb_postgresql_unpriv_user'; -select pg_sleep(.1); -alter table c.t3 rename column the_geom_webmercator to webmerc2; - -RESET SESSION AUTHORIZATION; -select - tabname::text, - round(extract('secs' from now() - updated_at)*10) as agecs -FROM CDB_TableMetadata WHERE tabname = 'c.t3'::regclass; - ----------------------------- --- ALTER TABLE DROP COLUMN ----------------------------- -SET SESSION AUTHORIZATION 'cartodb_postgresql_unpriv_user'; -select pg_sleep(.1); -alter table c.t3 drop column the_geom_webmercator; - -RESET SESSION AUTHORIZATION; -select - tabname::text, - round(extract('secs' from now() - updated_at)*10) as agecs -FROM CDB_TableMetadata WHERE tabname = 'c.t3'::regclass; - ----------------------------- --- ALTER TABLE ADD COLUMN ----------------------------- -SET SESSION AUTHORIZATION 'cartodb_postgresql_unpriv_user'; -select pg_sleep(.1); -alter table c.t3 add column id2 int; - -RESET SESSION AUTHORIZATION; -select - tabname::text, - round(extract('secs' from now() - updated_at)*10) as agecs -FROM CDB_TableMetadata WHERE tabname = 'c.t3'::regclass; - ----------------------------- --- DROP TABLE ----------------------------- - -RESET SESSION AUTHORIZATION; -drop schema c cascade; -select count(*) from CDB_TableMetadata; - -DROP OWNED BY cartodb_postgresql_unpriv_user; -DROP ROLE cartodb_postgresql_unpriv_user; -DROP FUNCTION _CDB_UserQuotaInBytes();