How do I write a postgres stored procedure that doesn't return anything?

plpgsql, postgresql, stored-procedures

Solution

It's not the function that returns value, it's the `SELECT` you used to call it. If it doesn't return any rows, it doesn't run your function.

Problem

How do I write a simple stored procedure in postgres that doesn't return a value at all? Even with a void return type when I call the stored procedure I get a single row back. ``` CREATE FUNCTION somefunc(in_id bigint) RETURNS void AS $$ BEGIN DELETE from test_table where id = in_id; END; $$ LANGUAGE plpgsql; ```

Original source