Partial data dumps using Postgres Row Level Security
In order to create seed data for testing without compromising sensitive information, one can use PostgreSQL's Row Level Security (RLS). This involves creating a restricted access user and defining RLS rules for that user. The exporter user is then used to dump the desired data using pg_dump with the --enable-row-security flag. Various data access patterns such as email rules, recent data, and flags can be applied depending on the requirements. Alternative strategies like Snaplet and Database Lab Engine are also available for running development environments.
Company
Supabase
Date published
June 28, 2022
Author(s)
Paul Copplestone
Word count
533
Language
English
Hacker News points
2