Search Postgresql Archives

pg_dump & RLS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,
Sorry if this is not the appropriate list, I think so.

- ¿is posible to export using pg_dump only the rows that satisfy a rls check?
- Of course, yes, use the --enable-row-security option in pg_dump
- Yes, but my RLS _expression_ relies on a GUC:
CREATE POLICY my_policy  ON my_table  USING (company_id = current_setting('company_id')::int);
Prior to starting dumping I need to set the company_id GUC into the session, if not, there's no way to only export some rows.

Any ideas? 
- Execute a command before starting the export
- Some kind of login trigger for a special user
- ...

Thank you!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux