Skip to content

feat: remove trigger usage#4

Merged
mble merged 1 commit into
mainfrom
remove-trigger
Jan 12, 2026
Merged

feat: remove trigger usage#4
mble merged 1 commit into
mainfrom
remove-trigger

Conversation

@mble

@mble mble commented Jan 12, 2026

Copy link
Copy Markdown
Owner

This commit shifts us straight until the hook instead of using the event trigger.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR transitions DDL guarding from using PostgreSQL event triggers to a ProcessUtility hook implementation. The change enables more direct interception of DDL commands and eliminates the need for the event trigger infrastructure.

Changes:

  • Moved DDL detection logic from event trigger callback to ProcessUtility hook
  • Updated log_sentinel_event to return bool instead of void for better error handling
  • Added version 1.0.2 with migration script to drop the event trigger

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ddl_guard.control Bumped version from 1.0.1 to 1.0.2
ddl_guard.c Added is_guarded_ddl_statement function, moved DDL guarding logic to ProcessUtility hook, changed log_sentinel_event signature to bool for graceful error handling
ddl_guard--1.0.2.sql New installation script without event trigger creation
ddl_guard--1.0.1--1.0.2.sql Migration script that drops the event trigger
Makefile Added new SQL files to DATA list
README.md Added upgrade instructions for version 1.0.2
test/regular/sql/sentinel.sql Combined SELECT and \gset into single line for cleaner output
test/regular/expected/sentinel.out Updated expected output to match new test format

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ddl_guard.c
Comment on lines +180 to +181
static bool
is_guarded_ddl_statement(Node *parsetree, CommandTag *commandTag)

Copilot AI Jan 12, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is_guarded_ddl_statement is missing a forward declaration. For consistency with other static functions like is_guarded_dcl_statement (declared at line 45), this function should be declared in the forward declarations section near the top of the file.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot re-review

This commit shifts us straight until the hook instead of using the event
trigger.

Copilot AI commented Jan 12, 2026

Copy link
Copy Markdown

@mble I've opened a new pull request, #5, to work on those changes. Once the pull request is ready, I'll request review from you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants