what's the difference between `with check` and `us...
# help
s
what's the difference between
with check
and
using
for policies?
n
Hello @samjmck! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
g
From Postgres Docs https://www.postgresql.org/docs/current/sql-createpolicy.html
Copy code
Existing table rows are checked against the expression specified in USING, while new rows that would be created via INSERT or UPDATE are checked against the expression specified in WITH CHECK. When a USING expression returns true for a given row then that row is visible to the user, while if false or null is returned then the row is not visible. When a WITH CHECK expression returns true for a row then that row is inserted or updated, while if false or null is returned then an error occurs.
n
samjmck (2022-05-06)
Thread was archived by @samjmck. Anyone can send a message to unarchive it.