I have a table. I wrote a function in plpgsql that inserts a row into this table:
INSERT INTO simpleTalbe (name,money) values(\'momo\',1000) ;
Use the RETURNING clause. You need to save the result somewhere inside PL/pgSQL - with an appended INTO
..
INSERT INTO simpleTalbe (name,money) values('momo',1000)
RETURNING id
INTO _my_id_variable;
_my_id_variable
must have been declared with a matching data type.
Related:
Depending on what you plan to do with it, there is often a better solution with pure SQL. Examples: