How to create a function that returns nothing

I want to write a function with pl / pgsql I use PostgresEnterpreis Manager v3 and use the shell to create the function, but in the shell I have to determine the type of the return value. If I do not define the return type, I cannot create a function.

How to create a function without a return result ie A function that creates a new table?

+49
plpgsql postgresql
Jan 08 '13 at 14:09
source share
1 answer

Use RETURNS void as shown below:

 CREATE FUNCTION stamp_user(id int, comment text) RETURNS void AS $$ #variable_conflict use_variable DECLARE curtime timestamp := now(); BEGIN UPDATE users SET last_modified = curtime, comment = comment WHERE users.id = id; END; $$ LANGUAGE plpgsql; 
+76
Jan 08 '13 at 14:13
source share



All Articles