Re: [SQL] User Defined Functions Errors

2005-04-19 Thread KÖPFERL Robert
n |-Original Message- |From: A. Kulikov [mailto:[EMAIL PROTECTED] |Sent: Montag, 18. April 2005 20:32 |To: pgsql-sql@postgresql.org |Subject: [SQL] User Defined Functions Errors | | |How to I return an error from inside a user defined function? For |example the following: | |CREATE or R

Re: [SQL] User Defined Functions Errors

2005-04-18 Thread Michael Fuhr
On Mon, Apr 18, 2005 at 10:32:26PM +0400, A. Kulikov wrote: > > How to I return an error from inside a user defined function? Use RAISE. See "Errors and Messages" in the PL/pgSQL documentation. http://www.postgresql.org/docs/8.0/interactive/plpgsql-errors-and-messages.html -- Michael Fuhr http

[SQL] User Defined Functions Errors

2005-04-18 Thread A. Kulikov
How to I return an error from inside a user defined function? For example the following: CREATE or REPLACE FUNCTION drop_node (integer) RETURNS text AS ' DECLARE mleft INTEGER; mright INTEGER; BEGIN -- Check if the desired node exists SELECT lft, rgt FROM structure WHERE id = $1 INTO mleft, m