Skip to content

Commit d6e9f75

Browse files
committed
Remove the update script's now-redundant capture__start re-declaration
0.1.0 and stable are byte-identical for this function's body once the linter's annotation (PR #16's own, separate content) isn't part of this branch -- the CREATE OR REPLACE was a no-op here. Verified via bin/test_existing's structural diff (clean) and a full local run (7/7 pgTAP files, dump/restore, test-build).
1 parent 066ca1f commit d6e9f75

1 file changed

Lines changed: 0 additions & 54 deletions

File tree

sql/object_reference--0.1.0--stable.sql

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -594,60 +594,6 @@ $body$
594594
, 'Trigger function to ensure capture__stop() is called an appropriate number of times.'
595595
);
596596

597-
/*
598-
* capture__start(object_group_id int): body text only differs from 0.1.0 by
599-
* an added "EXCLUDED CODE" annotation on an already-dead comment block (the
600-
* commented-out CREATE TEMP TABLE ... AS alternative) -- no behavior change,
601-
* but recreated anyway so the update path converges byte-for-byte with a
602-
* fresh install rather than leaving a purely cosmetic difference in place.
603-
*/
604-
SELECT __object_reference.create_function(
605-
'object_reference.capture__start'
606-
, $args$
607-
object_group_id _object_reference.object_group.object_group_id%TYPE
608-
$args$
609-
, 'int SECURITY DEFINER LANGUAGE plpgsql'
610-
, $body$
611-
DECLARE
612-
c_next_level int := coalesce(capture_level, 0) + 1 FROM object_reference.capture__get_current();
613-
BEGIN
614-
-- Ensure object group exists
615-
PERFORM object_reference.object_group__get(object_group_id);
616-
617-
INSERT INTO pg_temp.__object_reference__ddl_capture
618-
SELECT c_next_level, capture__start.object_group_id
619-
;
620-
RETURN c_next_level;
621-
622-
EXCEPTION WHEN undefined_table THEN
623-
/* EXCLUDED CODE
624-
CREATE TEMP TABLE __object_reference__ddl_capture AS
625-
SELECT c_next_level, capture__start.object_group_id
626-
;
627-
*/
628-
CREATE TEMP TABLE __object_reference__ddl_capture(
629-
capture_level int PRIMARY KEY
630-
, object_group_id INT NOT NULL -- temp tables can't reference permanent ones
631-
);
632-
-- This breaks if run directly under plpgsql
633-
EXECUTE $code$
634-
CREATE CONSTRAINT TRIGGER verify_capture_stop AFTER INSERT
635-
ON pg_temp.__object_reference__ddl_capture
636-
DEFERRABLE INITIALLY DEFERRED
637-
FOR EACH ROW -- CONSTRAINT triggers must be per-ROW
638-
EXECUTE PROCEDURE _object_reference._tg_capture_safety()
639-
$code$;
640-
641-
INSERT INTO pg_temp.__object_reference__ddl_capture
642-
SELECT c_next_level, capture__start.object_group_id
643-
;
644-
RETURN c_next_level;
645-
END
646-
$body$
647-
, 'Begin capturing newly created objects to <object_group_id>. Returns current capture level.'
648-
, 'object_reference__usage'
649-
);
650-
651597
/*
652598
* New: example/debug event-trigger functions (not wired to any CREATE EVENT
653599
* TRIGGER -- 0.1.0 had an equivalent commented-out "snitch" example instead).

0 commit comments

Comments
 (0)