Can't create INSERT policy
See original GitHub issueBug report
Describe the bug
I am unable to create new INSERT
policies. It complains of a missing definition even though it’s set.
To Reproduce
- Create a new insert policy
- Enter a definition
- Click save
Expected behavior
Policy should be created, instead we get an error asking for a definition or a check.
Screenshots

System information
Firefox 89 Windows 10
Additional context
Without going to “Advanced” for INSERT
, you can’t actually set a definition (“with check” is the only thing that shows). Related?
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Documentation: 15: CREATE POLICY - PostgreSQL
An INSERT policy cannot have a USING expression, as it only applies in cases where records are being added to the relation. Note...
Read more >PostgreSQL Row Security Policies is not working for CREATE ...
Your policy makes the table appear empty for the rls_user , because it has no USING clause. Therefore, the UPDATE will never modify...
Read more >Create and apply information management policies
On the Information Management Policy Settings page, select Define a policy, and then click OK.
Read more >Adding store policies - Shopify Help Center
You can add or generate the following policies for your Shopify store: Refund policy; Privacy policy; Terms of service; Shipping policy; Legal notice ......
Read more >PostgreSQL Row Level Security (RLS): Basics and Examples
You can create row level security policies for specific commands like SELECT, ... and cannot INSERT new rows belonging to another manager.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@alexturpin there is a note in the insert docs that describes this issue:
So, two options:
SELECT
returning
param tominimal
:I also glossed over this and wasted a bunch of time spinning my wheels… thank goodness I found this issue. I hope more attention can be brought to this “gotcha” detail so others don’t go down the same path. Maybe add a warning on the policies section (auth/policies page) that a table only has an insert setup and could cause insert op to fail (code 42501) until select access is setup.