Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions sql/object_reference.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1480,8 +1480,10 @@ BEGIN
RAISE DEBUG 'dropped_objects(): %', r;
END LOOP;

-- Multiple objects might have been affected
-- Could potentially be done with a writable CTE
/*
* Multiple objects might have been affected
* Could potentially be done with a writable CTE
*/
FOR r_object_v IN
SELECT _object_v.*
FROM pg_catalog.pg_event_trigger_dropped_objects() d
Expand Down Expand Up @@ -1570,20 +1572,14 @@ $$);

CREATE EVENT TRIGGER zzz__object_reference_drop
ON sql_drop
-- For debugging
--WHEN tag IN ( 'ALTER TABLE', 'DROP TABLE' )
EXECUTE PROCEDURE _object_reference._etg_drop()
;
CREATE EVENT TRIGGER zzz_object_reference__fix_identity
ON ddl_command_end
-- For debugging
--WHEN tag IN ( 'ALTER TABLE', 'DROP TABLE' )
EXECUTE PROCEDURE _object_reference._etg_fix_identity()
;
CREATE EVENT TRIGGER zzz_object_reference_capture
ON ddl_command_end
-- For debugging
--WHEN tag IN ( 'ALTER TABLE', 'DROP TABLE' )
EXECUTE PROCEDURE _object_reference._etg_capture()
;

Expand Down
3 changes: 0 additions & 3 deletions test/dump/load_all.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ SELECT c.* FROM test_object o, test__create(o) c ORDER BY o.seq ASC;
SELECT c.* FROM test_object o, test__register(o) c ORDER BY o.seq DESC; -- Would be nice to randomize...
SELECT c.* FROM test_object o, test__verify(o) c ORDER BY o.seq ASC;

--SET client_min_messages = DEBUG;
--\i test/pgxntool/finish.sql

CREATE SCHEMA test_capture_support;
SET search_path = test_capture_support, tap, public;

Expand Down
12 changes: 8 additions & 4 deletions test/dump/verify.sql
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ SELECT c.*
;


-- First verify that object group prevents drop
-- (see below too)
/*
* First verify that object group prevents drop
* (see below too)
*/
SELECT c.*
FROM test_capture_support.test_object o
--, test_capture_support.test__drop(o) c
Expand All @@ -79,8 +81,10 @@ SELECT lives_ok(
) FROM object_group_ids
;

-- Drop objects for real this time
-- (see above too)
/*
* Drop objects for real this time
* (see above too)
*/
SELECT c.*
FROM test_capture_support.test_object o
, test_capture_support.test__drop(o) c
Expand Down
6 changes: 4 additions & 2 deletions test/helpers/object_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ INSERT INTO test_prereq VALUES
, ($$CREATE FUNCTION "test type out"("test type") RETURNS cstring LANGUAGE 'internal' IMMUTABLE AS 'int2in'$$)
;

-- \N is null character
-- sql-lint:disable-block prefer-short-type: COPY payload data, not real type references
/*
* \N is null character
* sql-lint:disable-block prefer-short-type: COPY payload data, not real type references
*/
COPY test_object(object_type, object_name, secondary, create_command, drop_command) FROM STDIN (DELIMITER '|');
table|test table||%("test column" int)|
index|test table test index||%ON "test table"("test column")|
Expand Down
6 changes: 4 additions & 2 deletions test/sql/capture.sql
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ SELECT is_empty(
-- Create
SELECT c.* FROM test_object o, test__create(o) c ORDER BY o.seq ASC;

-- Manually register an object; make certain it does not show up in group
-- NOTE! Other tests depend on this working!
/*
* Manually register an object; make certain it does not show up in group
* NOTE! Other tests depend on this working!
*/
SELECT lives_ok(
$$CREATE TEMP TABLE ogi__object_id AS
SELECT object_reference.object__getsert('table', 'object_group_ids', NULL) AS object_id
Expand Down
2 changes: 0 additions & 2 deletions test/sql/event_trigger.sql
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ SELECT is(
, 'Exactly 1 test view record'
);

-- s/column_test/column_filler/g
-- Change 1 to 2 in getsert
SELECT lives_ok(
$$CREATE TEMP TABLE column_filler AS SELECT * FROM _object_reference._object_v__for_update('table column', 'table_under_test'::regclass, 2)$$
, $$CREATE TEMP TABLE column_filler AS SELECT * FROM _object_reference._object_v__for_update('table column', 'table_under_test'::regclass, 2)$$
Expand Down
Loading