Nander
11/13/2021, 2:16 PMpath_tokens
, so my approach was to modify it in the function.
sql
create or replace function
public.create_post_on_bucket_upload()
returns trigger as
$$
declare
post_id text;
begin
insert into public.posts (user_id)
values (
auth.uid()
)
returning id into post_id;
new.path_tokens[2] = post_id;
return new;
end;
$$ language plpgsql security definer;
it creates the function and I can run the upload process on my website, but the file name/location doesn't change. What did I do wrong?silentworks
11/13/2021, 2:46 PMNander
11/13/2021, 2:53 PMNander
11/13/2021, 2:55 PMsilentworks
11/13/2021, 2:56 PM