Skip to content

refactor: look up the HMAC key for each row in the KMS PostgreSQL trigger - #216

Merged
aaron-congo merged 2 commits into
mainfrom
fix/kms-pg-trigger-cache
Oct 20, 2026
Merged

aaron-congo merged 2 commits into
mainfrom
fix/kms-pg-trigger-cache

Conversation

@aaron-congo

Copy link
Copy Markdown
Contributor

The PostgreSQL trigger now reads the column's HMAC key from key_storage for every row instead of keeping a per-transaction copy in a setting, which simplifies the trigger SQL.

Measured on PostgreSQL 16, the lookup adds about 3 microseconds per row for multi-row transactions and no measurable cost for single-row transactions.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…gger

The PostgreSQL trigger now reads the column's HMAC key from key_storage
for every row instead of keeping a per-transaction copy in a setting,
which simplifies the trigger SQL.

Measured on PostgreSQL 16, the lookup adds about 3 microseconds per row
for multi-row transactions and no measurable cost for single-row
transactions.
@aaron-congo
aaron-congo requested a review from a team as a code owner October 20, 2026 00:11
sophia-bq
sophia-bq previously approved these changes Oct 20, 2026
Comment thread CHANGELOG.md Resolved
@aaron-congo
aaron-congo merged commit 9dcf5f1 into main Oct 20, 2026
11 checks passed
@aaron-congo
aaron-congo deleted the fix/kms-pg-trigger-cache branch October 20, 2026 18:58
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.

2 participants