Skip to content

v0.4.3: keyword names, shadow with RLS roles and partitions, receipts without personal data

Choose a tag to compare

@Shubh-Sgr Shubh-Sgr released this 02 Oct 08:35
· 6 commits to main since this release
6ac54dc

Fixes found by testing with hostile and real-world schema shapes: names that are Postgres keywords, row-level security policies for named roles, partitioned tables, and personal data in receipts.

npm install -g pgvouch@0.4.3
0.4.3
Fixed
Names that are Postgres keywords made generated SQL invalid. Only a short hand-written list of reserved words was quoted, so a table or column named case, window, both, binary, current_date (53 keywords in all) produced ALTER TABLE window ...: plan, shadow and the MCP plan_migration failed with a syntax error, and rewrite produced a script that couldn't run. Every keyword Postgres itself quotes is now quoted (the full list from PostgreSQL 13 to 17), and a test checks that each one gives SQL Postgres' parser accepts.
Shadow runs failed on targets with row-level security policies for named roles. A schema dump has no roles, so copying a target with CREATE POLICY ... TO app_user failed with "role does not exist", and shadow runs (and so LLM plans) couldn't run at all. The roles named by policies on the target and source are now created in the shadow container first, as placeholders without login or privileges.
Shadow runs failed for plans that read a partitioned table, e.g. a view over it ("permission denied"). Partitioned tables and partitions weren't handed to the plan role, because a rule meant only for sequences owned by a column skipped them.
A missing or extra materialized view is described as "materialized view", not "view".
Changed
Receipts no longer contain row values. Differing rows are listed by primary key and changed column names, like the MCP tools: a receipt is meant to be attached to tickets and audits, and row values can be personal data. pgvouch receipt --include-values keeps them.
Full changelog: v0.4.2...v0.4.3