pg RLS suggestions needed

From: Laura Smith <n5d9xq3ti233xiyif2vp(at)protonmail(dot)ch>
To: postgre <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: pg RLS suggestions needed
Date: 2022-09-19 09:04:34
Message-ID: uKBUtTKFKrYpM9ow3m7MKhbWrhAfGyXIFdrh7GDdZrfDB_Cs56J4JqMU2qpnr7SOR6peoSgfbPaeknGjG9p4_-AYMKXZrkXfGFbS9FDzmrY=@protonmail.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I've got a table with an RLS policy on it:

Policies:    POLICY "app_users_policy"
      USING ((app_id = CURRENT_USER))

Is there a way I'm not aware of (e.g. via Pl/PGSQL) that would allow "migration" of data from one RLS owner to another ?

At the moment, the only option I can think of is for the external app to login as one user, cache the data and then login as the other user and re-save it.

Basically the background is that I want to give users the ability to self-service migrate their existing app profile from "old" to "new" (the app being differentiated via RLS user on app_id)

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2022-09-19 09:12:57 Re: What ist the standard setting of FETCH_COUNT?
Previous Message Tiaswin 2022-09-19 08:19:56 What ist the standard setting of FETCH_COUNT?