Skip to content

Fix the pgcrypto procedure, and test it - #522

Merged
atovpeko merged 3 commits into
mainfrom
atovpeko/pgcrypto-test-plan
Sep 14, 2026
Merged

atovpeko merged 3 commits into
mainfrom
atovpeko/pgcrypto-test-plan

Conversation

@atovpeko

@atovpeko atovpeko commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Describe your changes

The pgcrypto procedure could not be completed as written: step 2 creates user_passwords, step 3 inserts into tbl_sym_crypt, a table the page never creates. A reader got relation "tbl_sym_crypt" does not exist, then no rows under a heading saying the passwords are listed. Both sample output blocks were captured against that other table and are regenerated from a real run.

Adds a 13-step test plan so it cannot regress. Six assertions, each proved able to fail before being trusted passing.

Affected pages

Related Issues

Issue: #number

Checklist before requesting a review

  • - This is ready for review. If not, raise as a draft PR
  • - I have reviewed my changes.
  • - I have confirmed the content is technically accurate.
  • - I have tested any code that is added or updated on the latest available version.
  • - I have confirmed the content is free of typos or grammar errors.
  • - I have verified all images and videos are clear and match production (or dev for unreleased features).
  • - I have checked the component kitchen sink for any visual breakage (only needed if you changed components, styles, or dependencies). A link to this PR's own preview appears under Affected pages once the build deploys.
  • - This references a feature that is public. If not, add a note and we can schedule the merge for after the feature release.

🤖 Generated with Claude Code

The pgcrypto procedure could not be completed as written. Step 2 creates
user_passwords, step 3 inserts into tbl_sym_crypt, and step 4 selects from
user_passwords and shows two rows. tbl_sym_crypt is created nowhere on the page,
so a reader following it gets `relation "tbl_sym_crypt" does not exist` at step
3 and then no rows at step 4, under a heading that says the passwords are listed.

Both sample output blocks were captured against that other table and were
misaligned besides, so they are regenerated from a real run of the corrected
procedure on PostgreSQL 17 with pgcrypto 1.3. The decrypt statement lost two
stray leading spaces at the same time.

Adds a test plan so this cannot regress. Thirteen steps, pure SQL, and six
assertions covering what the page actually claims: the extension installs, the
table exists, both rows land, the stored text contains no plaintext, and each
password round-trips back through pgp_sym_decrypt. Every assertion was proved
able to fail before it was trusted passing -- drop the extension, drop the table,
insert one row, store plaintext, or give either user the wrong secret, and the
matching assertion goes red.

The plan names a literal key where the page says <Password_Key>. The page is
right to leave that to the reader, and the plan is right to be literal: it runs
on a throwaway fork, and an angle placeholder in a run SQL step would reach the
database as text rather than being substituted.

Run: PASS on AWS, fork cg3by3jzyp, deleted after the run. Five statement steps
and six assertions held, matching the plan exactly.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@atovpeko
atovpeko requested a review from a team September 11, 2026 14:28
@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
tiger-data-docs Ready Ready Preview Sep 14, 2026 9:45am UTC

@atovpeko
atovpeko marked this pull request as draft September 11, 2026 14:29
@atovpeko
atovpeko marked this pull request as ready for review September 11, 2026 14:30
@atovpeko
atovpeko marked this pull request as draft September 11, 2026 14:30
@atovpeko
atovpeko marked this pull request as ready for review September 14, 2026 09:42
@github-actions

Copy link
Copy Markdown

✅ Checklist Complete

Thank you for taking the time to properly review your PR! All checklist items are complete.

@atovpeko
atovpeko merged commit 96ed65b into main Sep 14, 2026
6 checks passed
@atovpeko
atovpeko deleted the atovpeko/pgcrypto-test-plan branch September 14, 2026 10:41
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.

1 participant