ddl_guard.ccontains the extension implementation and hooks.ddl_guard.controlandddl_guard--1.0.1.sqldefine extension metadata and SQL objects.test/regularandtest/superuserhold pg_regress suites withsql/inputs andexpected/outputs (matching filenames).test/ddl_guard.confprovides a minimal config for regression runs.bin/andresults/may contain build/test artifacts; avoid committing generated files unless intentional.
makebuilds the shared library using PGXS.make installinstalls the extension into your Postgres instance (requires appropriate permissions).make installcheckruns regression tests via pg_regress usingtest/regularby default.make installcheck INPUTDIR=test/superuserruns the superuser test suite.PG_CONFIG=/path/to/pg_config maketargets a specific Postgres installation when multiple versions are installed.
- C code follows PostgreSQL extension conventions: tabs for indentation, K&R braces, and
ereport/errmsgfor errors. - Keep symbols and GUC names aligned with existing patterns (
ddl_guard.*). - Test files use concise snake_case names (e.g.,
ddl.sql,lobject.sql) mirrored inexpected/.
- Tests are pg_regress suites; each
sql/*.sqlfile must have a matchingexpected/*.out. - Add new tests to both
regularandsuperusersuites when behavior differs by role. - Run
make installchecklocally before submitting changes that affect behavior.
- Recent commits use short, scoped prefixes like
feat:,tests:, or simple descriptions (e.g.,update readme). - Keep commit messages imperative and focused on the change.
- PRs should describe behavior changes, include test output (or command used), and link any related issue if applicable.
- The extension must be loaded via
shared_preload_librariesand created withCREATE EXTENSION ddl_guard. - Key GUCs:
ddl_guard.enabled,ddl_guard.ddl_sentinel,ddl_guard.lo_sentinel. - Sentinel mode writes to
$PGDATA/pg_stat_tmp/and should be accounted for in ops workflows.