Repository navigation
fix(relay): skip boot-time DDL when the catalog already has the object - #21147
Conversation
CREATE INDEX IF NOT EXISTS and ALTER TABLE ADD COLUMN IF NOT EXISTS take their relation lock before the server evaluates the existence test, so a boot on an already-migrated database still joins the lock queue. Relation locks are granted in queue order, so every writer queues behind it. The shared runner now asks pg_catalog whether the index or column is already there and skips the statement when a row comes back, and 55P03 is no longer retried by default: with the pre-check ahead of it, a lock timeout means the object is genuinely missing and each retry re-enters the queue. Push keeps the old retry behind an explicit option.
…dable target Three defects found in review of the auth reference implementation: - The catalog query matched an index by name inside the table's namespace without checking it belonged to that table. Index names are unique per schema, not per table, so a same-named index on a sibling table answered yes and the real index was skipped forever. Added i.indrelid = t.oid. - Lock-target derivation read a keyword sitting in an identifier position as the object name: CREATE UNIQUE INDEX CONCURRENTLY ON t(c) yielded the name CONCURRENTLY, and ADD COLUMN IF NOT EXISTS with no column yielded IF. A wrong target is worse than none, so keywords are now excluded and an index or column statement whose target cannot be read throws at boot with the statement text instead of falling through to the lock path. - A concurrent-create collision retried the CREATE INDEX, taking SHARE on the table again for an object another director had just finished creating. The catalog is re-asked instead and a present object counts as skipped.
… all The two ALTER TABLE constraint statements were the last lock-taking statements without a pre-check, so every boot still took ACCESS EXCLUSIVE on relay_region_rehome_attempts twice. A lock target now carries the catalog answer that means there is nothing left to do. ADD CONSTRAINT skips when pg_constraint already names it; DROP CONSTRAINT IF EXISTS is the inverse and skips when it does not, because nothing to drop is nothing to do. The match is by name only: the CHECK body is generated from RELAY_REGIONS, so comparing it would re-run the swap on every region change. Changing a definition under the same name is an operator migration, and the rule comment beside SCHEMA says so. A bare DROP CONSTRAINT gets no target and throws at boot, because skipping it would swallow the undefined_object the server is supposed to raise. The census invariant is now that every lock-taking statement has a pre-check, with no exceptions, and the warm-boot Postgres test asserts zero statements sent rather than two.
… its first action `ALTER TABLE t ADD COLUMN IF NOT EXISTS a TEXT, ADD COLUMN IF NOT EXISTS b TEXT` derived the target for `a` alone, so once `a` existed the whole statement was skipped and `b` was never added. The first subcommand parses, so neither the parse throw nor the census caught it. A lock-taking ALTER TABLE with a comma outside parentheses, quotes and comments now throws at boot. One action per statement, or no pre-check is possible. Commas inside a parenthesised type, a CHECK body, a quoted default or a comment are unaffected, and push's 18 statements still parse.
There was a problem hiding this comment.
ℹ️ No critical issues — two parser edge cases inline, plus one compatibility-note nitpick.
Reviewed changes
- Catalog pre-check wired into relay boot —
@orca-cloud/postgres-schemaderives each lock-taking statement's target from its own text and askspg_catalogbefore sending it, so a warm boot on a migrated database issues zero lock-taking DDL. - Classification fix for comment-prefixed statements — leading
--//* */comments are stripped before classification, so the commentedCREATE INDEXonrelay_connection_baseskeeps both its pre-check and its collision handling. - Index/constraint identity — the index pre-check is tied to its table (
i.indrelid = t.oid) inside the table's namespace; constraint swaps are matched by name with opposite polarities (ADDskips present,DROP ... IF EXISTSskips absent). - Retry policy —
55P03is no longer retried by default (relay fails the boot and names the statement); push opts back in withretryLockTimeout: true, having no pre-check. A concurrent-create collision re-asks the catalog instead of retrying the statement. - Tests — derivation/classification/pre-check unit tests, a relay golden census of the 30 lock-taking statements, and a real-PostgreSQL differential test (warm boot completes under a held
ACCESS EXCLUSIVE; a negative control shows the same boot fails55P03without the pre-check).
ℹ️ Nitpicks
requireSchemaLockTargetruns for every caller, including one that passes nocatalogQuery(push). The PR note says a no-catalog caller "behaves exactly as before apart from the55P03default", but an auto-namedCREATE INDEX, a multi-actionALTER TABLE, or a bareDROP CONSTRAINTnow fails that caller's boot too. Push's current statements all parse, so this is a documentation mismatch rather than a live bug.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
📝 WalkthroughWalkthroughThe PostgreSQL schema package now supports lock-target parsing, catalog pre-checks, structured results, and bounded retries. Relay startup uses these features to avoid unnecessary lock-taking DDL and validates its schema statements. Relay tests cover catalog behavior, lock targets, concurrent DDL, and timeout handling. Push explicitly enables lock-timeout retries because it does not use catalog pre-checks. The package test command now runs Vitest. Priority: ⬇️ Low Merge Risk: 🟡 Moderate · up to Valid schema statements can miss catalog objects or bypass pre-checking, potentially retaining an obsolete constraint or re-entering lock queues. These parser gaps should be fixed before merge. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 46.15% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 26 functions across 12 files. (1 skipped: 1 unsupported.) Full details: Description checkExplanation The description is detailed and covers the change, rationale, testing, compatibility, and checklist. However, the required Linked Issue section is incomplete because it contains only
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 2e71d4e1-71fc-4b50-8d7c-b9022eed4ff6
📒 Files selected for processing (13)
cloud/apps/push/src/push-database.tscloud/apps/relay/src/database-postgres-timeout.test.tscloud/apps/relay/src/database-statement-timeout-postgres.test.tscloud/apps/relay/src/database.tscloud/apps/relay/src/relay-schema-catalog-precheck-postgres.test.tscloud/apps/relay/src/relay-schema-lock-targets.test.tscloud/packages/postgres-schema/package.jsoncloud/packages/postgres-schema/src/apply-postgres-schema.test.tscloud/packages/postgres-schema/src/apply-postgres-schema.tscloud/packages/postgres-schema/src/catalog-object-precheck.tscloud/packages/postgres-schema/src/index.tscloud/packages/postgres-schema/src/schema-lock-target.test.tscloud/packages/postgres-schema/src/schema-lock-target.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
…s, count brackets Four findings from the bot reviews on #21147: - A comment between two keywords (ALTER TABLE t ADD /* note */ COLUMN c TEXT) was invisible to both the classification regexes and the must-parse shapes, so the statement got no target AND no throw and ran with no pre-check. Every comment is now stripped quote-aware before classification, nested block comments included. The server is still sent the original text. - hasTopLevelComma counted parentheses but not square brackets, so ADD COLUMN c bigint[] DEFAULT ARRAY[1, 2] read as two subcommands and failed the boot. - bareIdentifier split a qualified name on '.' regardless of quoting, so "a.b" became b", and it kept the written case while Postgres folds an unquoted identifier to lower case before storing it in relname, attname and conname. The name is now tokenised quote-aware and folded, with the qualified table text still passed to to_regclass as written. - sqlWithoutLeadingComments is renamed sqlWithoutComments to match. Relay's 74 statements and push's 18 all still parse, and no relay target name changed: every identifier there was already lower case.
A comment marker, comma, parenthesis or bracket inside `$$...$$` or `$tag$...$tag$` is text. The closing delimiter has to match the opening tag exactly, so an inner `$$` inside a `$tag$` body is more text rather than the end, and a tag cannot start with a digit, which keeps a `$1` placeholder from reading as an opener. Relay's pg_stat_statements DO block is the only dollar-quoted statement in the schema, and it now survives the stripper byte-identical. A test asserts that against the real statement.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Comment stripping made complete and quote-aware —
sqlWithoutCommentsreplaces the leading-only stripper with a single pass that honours'/"quoting (doubled-quote escapes included) and nested block comments, replacing each comment with a space. Classification now seesALTER TABLE t ADD /* note */ COLUMN c, which previously yielded no target and no throw and so sent the DDL unchecked; the server still receives the original text, pinned by a new test. - Catalog names tokenised and folded like Postgres —
bareIdentifieris replaced byqualifiedParts/catalogName: dots split only between identifiers ("a.b"stays one name),""unescapes to", and unquoted names lower-case to the form stored inrelname/attname/conname. Previously a quoted dot or a mixed-case name would miss the catalog row and rebuild the object on every boot. - Square-bracket depth in the multi-action guard —
hasTopLevelCommacounts[/], sobigint[]andDEFAULT ARRAY[1, 2]no longer read as a secondALTER TABLEsubcommand, while a genuine second subcommand after an array default is still caught. - Regression tests — comment-between-keywords derivation, catalog name folding (dot-in-quotes, case folding, doubled quotes, qualified tables), square brackets in both directions, and a test pinning the original comment-bearing statement text as what reaches the server.
Both prior inline threads are addressed by a479d1d and resolved.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Dollar-quoted bodies made opaque to both scanners —
dollarQuoteEndrecognises$$...$$and$tag$...$tag$(the optional tag cannot start with a digit, so$1placeholders are untouched) and bothsqlWithoutCommentsandhasTopLevelCommacopy the region through verbatim. A comment marker, comma, parenthesis or bracket inside a PL/pgSQL body is now text, closing the last place where the classification text could diverge from what the server parses. - Tests — a unit group for dollar-quoted defaults (comment marker and comma treated as text, a tagged body with an inner
$$, numbered placeholders, an unterminated quote, and a genuine second subcommand after a dollar-quoted default still caught), plus a census test proving relay's realDO $relay_statement_stats$migration survivessqlWithoutCommentsbyte-identical.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
stablyai#21147) * fix(relay): skip boot-time DDL when the catalog already has the object CREATE INDEX IF NOT EXISTS and ALTER TABLE ADD COLUMN IF NOT EXISTS take their relation lock before the server evaluates the existence test, so a boot on an already-migrated database still joins the lock queue. Relation locks are granted in queue order, so every writer queues behind it. The shared runner now asks pg_catalog whether the index or column is already there and skips the statement when a row comes back, and 55P03 is no longer retried by default: with the pre-check ahead of it, a lock timeout means the object is genuinely missing and each retry re-enters the queue. Push keeps the old retry behind an explicit option. * fix(relay): tie the index pre-check to its table and fail on an unreadable target Three defects found in review of the auth reference implementation: - The catalog query matched an index by name inside the table's namespace without checking it belonged to that table. Index names are unique per schema, not per table, so a same-named index on a sibling table answered yes and the real index was skipped forever. Added i.indrelid = t.oid. - Lock-target derivation read a keyword sitting in an identifier position as the object name: CREATE UNIQUE INDEX CONCURRENTLY ON t(c) yielded the name CONCURRENTLY, and ADD COLUMN IF NOT EXISTS with no column yielded IF. A wrong target is worse than none, so keywords are now excluded and an index or column statement whose target cannot be read throws at boot with the statement text instead of falling through to the lock path. - A concurrent-create collision retried the CREATE INDEX, taking SHARE on the table again for an object another director had just finished creating. The catalog is re-asked instead and a present object counts as skipped. * fix(relay): pre-check constraint swaps so a warm boot sends no DDL at all The two ALTER TABLE constraint statements were the last lock-taking statements without a pre-check, so every boot still took ACCESS EXCLUSIVE on relay_region_rehome_attempts twice. A lock target now carries the catalog answer that means there is nothing left to do. ADD CONSTRAINT skips when pg_constraint already names it; DROP CONSTRAINT IF EXISTS is the inverse and skips when it does not, because nothing to drop is nothing to do. The match is by name only: the CHECK body is generated from RELAY_REGIONS, so comparing it would re-run the swap on every region change. Changing a definition under the same name is an operator migration, and the rule comment beside SCHEMA says so. A bare DROP CONSTRAINT gets no target and throws at boot, because skipping it would swallow the undefined_object the server is supposed to raise. The census invariant is now that every lock-taking statement has a pre-check, with no exceptions, and the warm-boot Postgres test asserts zero statements sent rather than two. * fix(relay): refuse a multi-action ALTER TABLE instead of pre-checking its first action `ALTER TABLE t ADD COLUMN IF NOT EXISTS a TEXT, ADD COLUMN IF NOT EXISTS b TEXT` derived the target for `a` alone, so once `a` existed the whole statement was skipped and `b` was never added. The first subcommand parses, so neither the parse throw nor the census caught it. A lock-taking ALTER TABLE with a comma outside parentheses, quotes and comments now throws at boot. One action per statement, or no pre-check is possible. Commas inside a parenthesised type, a CHECK body, a quoted default or a comment are unaffected, and push's 18 statements still parse. * fix(relay): strip every comment before classifying, fold catalog names, count brackets Four findings from the bot reviews on stablyai#21147: - A comment between two keywords (ALTER TABLE t ADD /* note */ COLUMN c TEXT) was invisible to both the classification regexes and the must-parse shapes, so the statement got no target AND no throw and ran with no pre-check. Every comment is now stripped quote-aware before classification, nested block comments included. The server is still sent the original text. - hasTopLevelComma counted parentheses but not square brackets, so ADD COLUMN c bigint[] DEFAULT ARRAY[1, 2] read as two subcommands and failed the boot. - bareIdentifier split a qualified name on '.' regardless of quoting, so "a.b" became b", and it kept the written case while Postgres folds an unquoted identifier to lower case before storing it in relname, attname and conname. The name is now tokenised quote-aware and folded, with the qualified table text still passed to to_regclass as written. - sqlWithoutLeadingComments is renamed sqlWithoutComments to match. Relay's 74 statements and push's 18 all still parse, and no relay target name changed: every identifier there was already lower case. * fix(relay): treat a dollar-quoted body as opaque in both scanners A comment marker, comma, parenthesis or bracket inside `$$...$$` or `$tag$...$tag$` is text. The closing delimiter has to match the opening tag exactly, so an inner `$$` inside a `$tag$` body is more text rather than the end, and a tag cannot start with a digit, which keeps a `$1` placeholder from reading as an opener. Relay's pg_stat_statements DO block is the only dollar-quoted statement in the schema, and it now survives the stripper byte-identical. A test asserts that against the real statement.

ELI5
When a relay director starts up, it re-runs its whole database setup script: create these tables, create these indexes, add these columns. Every statement says "only if it isn't already there," so on a database that has been running for months this is supposed to be a no-op.
It isn't. PostgreSQL takes the lock on the table before it checks whether the index already exists. So a startup that changes nothing still gets in line for a lock on every indexed table. And locks are handed out strictly in the order they were requested, so anything that lines up behind that startup waits too, even though the startup is about to do nothing at all.
Normally the startup is at the front of the line and nobody notices. If a long maintenance job already holds the table, the startup waits, and every ordinary write that arrives after it waits behind the startup. That is how a change-nothing boot takes the service down.
This PR makes startup ask the catalog first, in plain English: "is this index already there?" That question takes no lock on the table. When the answer is yes, the statement is never sent, so the boot never gets in line.
What Changed
Before. Every relay boot against PostgreSQL sent all 74 schema statements, 30 of which take a relation lock. On a healthy database this was invisible. On 2026-09-16 the auth service, which has the same shape, hit a forced anti-wraparound autovacuum holding a large table; its boot queued behind the vacuum, every write queued behind the boot, and the service crash-looped. Relay's
relay_control_connection_reservationsis 5.1 GB with two indexes in the boot script, and two more relay tables reach their forced freeze around 2026-09-21.After. A boot on an already-migrated database sends zero lock-taking statements. It reads
pg_class/pg_indexfor each index,pg_attributefor each added column, andpg_constraintfor each constraint swap, on the same connection, and skips the statement when the catalog gives the answer that means there is nothing left to do. Measured against a real server: all 30 skipped. Nothing about the SQLite path changed.Mechanism.
cloud/packages/postgres-schemagained the lock-target derivation and the pre-check. The classification regexes were start-anchored with\s, which never matches--, so any statement carrying the comment written above it (the schema string is split on;, so it does) fell out of classification entirely and would have had no pre-check at all. Every comment is now stripped before classification, quote-aware and handling nested block comments, not only the leading block. A comment between two keywords, as inALTER TABLE t ADD /* note */ COLUMN c TEXT, was invisible to both the parse regexes and the must-parse shapes, so it produced no target and no throw and ran unchecked. The server is always sent the original statement text; only classification reads the stripped copy. A dollar-quoted body,$$...$$or$tag$...$tag$, is opaque to the stripper and to the comma scanner, so a comment marker, comma, parenthesis or bracket inside one is text. Relay'spg_stat_statementsblock is the only such statement and survives byte-identical.relname,attnameandconname, so comparing the written case would miss the row and rebuild the object on every boot. A qualified name is tokenised quote-aware, so"a.b"is one identifier rather than two, and the table reference still reachesto_regclassexactly as written.to_regclassis used for the table so a fresh database returns no row rather than erroring. The index is matched inside the table's own namespace and tied to the table withi.indrelid = t.oid. Index names are unique per schema, not per table, so without that condition a name freed on one table and taken on another answers yes and the real index is skipped forever. A PostgreSQL test reproduces exactly that, and fails without the condition.CREATE UNIQUE INDEX CONCURRENTLY ON t(c)otherwise readsCONCURRENTLYas the index name, andADD COLUMN IF NOT EXISTSwith no column readsIFas the column. A wrong target is worse than no target, because the pre-check then asks about something that does not exist and sends the statement anyway, or worse, skips forever. Any index or column statement whose target cannot be read now throws at boot with the statement text instead of falling through to the lock path. Schema-qualified tables,UNIQUE,CONCURRENTLY,IF NOT EXISTSand double-quoted identifiers all derive correctly, with the qualified name used forto_regclassand the bare identifier forrelname/attname.ADD CONSTRAINTskips whenpg_constraintalready names it;DROP CONSTRAINT IF EXISTSskips when it does not, because nothing to drop is nothing to do. The match is by name only: the CHECK body is generated from the region list, so comparing it would re-run the swap on every region change, and anADD CONSTRAINTis the one statement here that scans the table. Changing a definition under the same name therefore does nothing on boot; an operator drops it and the next boot adds the current definition back. The rule comment besideSCHEMAsays so, and a PostgreSQL test walks that sequence.ALTER TABLEthrows at boot rather than pre-checking its first action.ALTER TABLE t ADD COLUMN IF NOT EXISTS a TEXT, ADD COLUMN IF NOT EXISTS b TEXTderives the target foraalone, so onceaexists the whole statement is skipped andbis never added. The first subcommand parses, so nothing else here would catch it. Commas inside a parenthesised type, a CHECK body, a quoted default, a comment, or square brackets such asbigint[] DEFAULT ARRAY[1, 2]are unaffected.DROP CONSTRAINT, withoutIF EXISTS, gets no target and throws at boot. Skipping it when the constraint is absent would swallow theundefined_objectthe server is supposed to raise.42P07,42710,23505) re-asks the catalog rather than retrying the statement. Another director finishing the sameCREATE INDEXa moment earlier used to cost a retry that took SHARE on the table all over again for an object that was already there. A present object now counts as skipped, and the retry only happens when the catalog still says absent.indisvalid. An index left invalid by a cancelledCREATE INDEX CONCURRENTLYis skipped byIF NOT EXISTStoday too; treating invalid as absent would newly take the lock for exactly the indexes a failed build left behind. The flag is reported in the skip event so an operator can still see it.55P03(lock timeout) is no longer retried by default. With the pre-check ahead of it, a lock timeout means the object really is missing and this boot lost the queue. Retrying re-enters the lock queue and parks every writer behind it again for another timeout. It now fails once and logs which statement could not take its lock. The push gateway has no pre-check, so a lock timeout there still says nothing about whether the object exists; it keeps the old bounded retry behind an explicitretryLockTimeoutoption.orca_relay_postgres_schema_object_presentwith kind, table, name andindisvalid, and every boot ends with an..._appliedsummary of ran vs skipped.cloud/apps/relay/src/database.tswires the pre-check into the untimed schema pool, coveringPOSTGRES_SCHEMA_MIGRATIONSas well asSCHEMA:ALTER TABLE ... ADD COLUMN IF NOT EXISTStakes ACCESS EXCLUSIVE even when the column is already there.POSTGRES_LOCK_TIMEOUT_MSstays at 1 s.The between-steps rule, added as a comment beside
SCHEMAand pinned by a test: no new index, column or constraint onrelay_control_connection_reservations,relay_confirm_results,relay_audit_events,relay_connection_bases, or any other large table may be added toSCHEMAorPOSTGRES_SCHEMA_MIGRATIONS. The pre-check skips a statement only once the object exists, so a brand-new index reports missing on every director at once and each one runs a non-concurrent build over the whole table. The 1 s timeout bounds how long that build waits for its lock, not how long it holds it. Build it out of band withCREATE INDEX CONCURRENTLY, then add it toSCHEMA, where the pre-check skips it forever after.Why
The 1 s
lock_timeoutalone does not fix this. It bounds a single wait; it does not stop the boot from entering the queue, and the shared runner then retried55P03for 30 s, so a boot during a forced freeze parked writers for roughly a second per retry and then crash-looped. Raising the timeout makes it worse and lowering it does not help, because the damage is the queue entry, not the wait.Dropping the
IF NOT EXISTSstatements from boot entirely and moving to versioned migrations is the right end state but a much larger change, and it leaves a fresh database with no way to bootstrap.Asking the catalog first is the smallest change that removes the queue entry:
pg_class,pg_indexandpg_attributereads take no lock on the table. It is also self-maintaining, because the lock target is derived from the statement text, so a renamed index cannot drift away from its own pre-check.The work went into the shared
@orca-cloud/postgres-schemapackage rather than a relay-local copy so relay and auth converge on one implementation instead of three.The invariant the census now enforces is that every statement taking a relation lock has a pre-check, with no exceptions. That is what lets the warm-boot test assert zero rather than a small number, and it is a much easier property to keep true than a list of tolerated exceptions.
Linked Issue
Fixes #
Visual Proof
N/A. No user-visible interface changed; this is boot-time database behaviour on the relay service.
Testing
Ran locally on macOS against PostgreSQL 17 in a disposable container, on a fresh database.
cloud/packages/postgres-schema—pnpm test: 2 files, 85 tests passed.cloud/apps/relay—pnpm testwith no database URL: 63 files passed, 21 skipped; 633 tests passed, 110 skipped.cloud/apps/relay—pnpm testwithORCA_RELAY_TEST_POSTGRES_URLset: 84 files passed, 744 tests passed, 1 skipped. The 21 previously skipped files ran.cloud/apps/push—pnpm testagainst its own fresh database: 29 files, 143 tests passed.cloud—pnpm typecheckandpnpm buildpass.The PostgreSQL test that matters most boots relay twice while a second session holds ACCESS EXCLUSIVE on
relay_control_connection_reservations. The boot completes while the lock is held. A companion test proves the lock really does block relay's DDL, so the first test cannot pass vacuously.New tests:
schema-lock-target.test.ts— comment-prefixed classification, multi-line and quoted and schema-qualified index and column derivation, constraint derivation in both polarities, the shapes that correctly yield no target, a table of seven malformed shapes that each must throw rather than derive a wrong target, a multi-actionALTER TABLEgroup covering the two-subcommand shapes and the comma placements that must not throw, a comments-between-keywords group, a catalog-name-folding group, a square-bracket group, and a dollar-quoted-body group.apply-postgres-schema.test.ts— comment-prefixed CREATE INDEX and CREATE TABLE each keep their own collision codes;55P03is not retried and names its statement; opt-in retry still works; the pre-check sends nothing when the catalog answers, skips an invalid index, and never probes for a statement that takes no relation lock.relay-schema-lock-targets.test.ts— a golden pin of relay's exact 30 lock-taking statements, a census that every statement in the real schema survives the strict derivation boot uses, a check that every derived name is a bare identifier rather than a keyword or a qualified name, and a check that the one comment-prefixed statement really is there so the census cannot pass vacuously.relay-schema-catalog-precheck-postgres.test.ts— against a real server: cold start then a warm boot issuing zero pre-checkable lock-taking statements, an invalid index skipped rather than rebuilt, a same-named index on a sibling table refusing to answer for this one, a dropped constraint being re-added and then skipped again, a boot completing under a held ACCESS EXCLUSIVE lock, and the negative control for that.Updated:
database-postgres-timeout.test.tsanddatabase-statement-timeout-postgres.test.tsboth pinned the old retry-and-queue behaviour and now pin the new one.AI Disclosure
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
applyPostgresSchemanow returns a summary instead ofvoid; both existing callers ignored the return value. The pre-check is opt-in per caller, so a consumer that passes no catalog query behaves exactly as before apart from the55P03default, which push opts out of explicitly.ORCA_RELAY_TEST_POSTGRES_URL.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)