Postgres SQL commands

2024-04-13
By: O. Wolfson

Create a policy that allows authenticated users to write to the avatars bucket.

sql
CREATE POLICY "AllowAuthenticatedWritesToAvatars"
ON storage.objects FOR INSERT
WITH CHECK (auth.uid() IS NOT NULL AND bucket_id = 'avatars'::text);