0

I need to run a remove_user function 1000s of times in single postgres query with a different values. I have created the statements.

Currently If I select all still only executes first line. I am using PGadmin.

SELECT public.remove_user(56);
SELECT public.remove_user(57);
SELECT public.remove_user(58);
SELECT public.remove_user(59);
SELECT public.remove_user(60);
SELECT public.remove_user(61);

1 Answer 1

1

That sounds more like a pgAdmin problem, than a Postgres problem.

But if pgAdmin can't run set of statements, then you can rewrite that to a single statement:

select public.remove_user(id)
from ( 
   values (56), (57), (58), (59), (60), (61)
) as x(id);
1
  • Agreed this should of worked but your solution worked well now RSI adverted Commented Jan 20, 2023 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.