fix: cast "char" catalog columns to text in the schema fingerprint
First CI run of the drift check confirmed the whole upgrade path works -
baseline schema plus all twelve since-added migrations applied cleanly -
and then died inside the fingerprint itself:
ERROR: operator is not unique: text || "char"
WHAT IS "char" (WITH QUOTES)
Postgres catalog columns like pg_class.relkind, pg_attribute.attidentity,
and pg_default_acl.defaclobjtype use the internal single-byte type "char"
(quoted) - a different type from char(1). Concatenating text with "char"
is ambiguous: the parser finds more than one usable || operator via
implicit casts and refuses to guess. An explicit ::text cast picks one.
Only the "char" columns needed casts; booleans and reals concatenate fine
(anynonarray || text is unique for them).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| Repository | open-legal-products/mike |
|---|---|
| Author | Amal <mamalanand3@gmail.com> |
| Authored | |
| Committed | |
| Parents | 4e136af6 |
| Stats | 1 file changed , +4 , -4 |
| Part of | Add schema drift checks for database upgrades |
Capture this commit into my fork
Download a Markdown prompt that tells Claude how to port this
exact commit into your working tree. Run it via
claude -p < capture-commit-128464e1.md
from inside the repo you want the change in.