"Jasbinder Singh Bali" <[EMAIL PROTECTED]> writes:

> I was wondering what would the function return if insert fails.

It would abort immediately and abort your transaction as well unless something
higher up catches the error.

> I want it to return 'success'  upon a successful insert and 'failure' if
> insert fails.

You need an EXCEPT WHEN clause, see:

http://www.postgresql.org/docs/8.2/interactive/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING


-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to