Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any support for row level security? #211

Open
pkit opened this issue Nov 28, 2019 · 3 comments
Open

Is there any support for row level security? #211

pkit opened this issue Nov 28, 2019 · 3 comments

Comments

@pkit
Copy link

pkit commented Nov 28, 2019

It seems like it is ignored...

@jmafc
Copy link
Member

jmafc commented Nov 28, 2019

Indeed. We never looked at it and AFAICR nobody brought it up until now.

@rattrayalex
Copy link

rattrayalex commented Apr 9, 2021

This would be really great to have for people who are interested in using a "Postgres-first" style of development, for example with postgraphile

EDIT: I might be interested in implementing this as a first contribution if a contributor thinks that might be a good idea / would be willing to point me in the right direction

@jmafc
Copy link
Member

jmafc commented Apr 9, 2021

In order to start adding support for row level security, you could do somewhat as follows:

  1. create a table with some row level security feature.
  2. examine the output of dbtoyaml for that table and compare it to the output of pg_dump to identify what's missing in the former.
  3. research what PG catalogs hold the data that is missing, e.g., pg_seclabel.
  4. edit code in pyrseas/dbobject, e.g., column.py to fetch (query static methods) the needed data into the internal structures and map it for YAML output (to_map methods). Or if you prefer a TDD route, first write a test for the desired output (e.g., in tests/dbobject/test_column.py).
  5. think about the SQL that would need to be generated by yamltodb when it found the attributes added in step 4 in an input YAML and no corresponding attributes in a target database catalogs (both of these represented in the Pyrseas internal structures).
  6. create test and/or code to generate the SQL.
  7. rinse and repeat for other row level security features.

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants