Re: exception handling in plpgsql

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Sibtay Abbas <sibtay_abbas(at)yahoo(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: exception handling in plpgsql
Date: 2004-12-31 20:18:39
Message-ID: 41D5B41F.30500@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


PEBKAC.

It has told you what the problem is. Use a handler for an exception that
actually exists. To see what these are, read
http://developer.postgresql.org/docs/postgres/plpgsql-errors-and-messages.html

cheers

andrew

Sibtay Abbas wrote:

>hello
>
>I am using the following sytex to handle exceptions in
>plpgsql (I am using postgres 8 rc1)
>
>....some code ........
>
>EXCEPTION
> WHEN NO_DATA THEN
> RAISE NOTICE 'NO DATA';
> WHEN OTHERS THEN
> RAISE NOTICE 'An exception occurred';
> RETURN emp_rec;
>
>and i receive the following error
>ERROR: unrecognized exception condition "no_data"
>
>How can i rectify this error?
>
>
>
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-12-31 20:53:24 Re: sysv_shmem potential problem
Previous Message Sibtay Abbas 2004-12-31 19:57:14 exception handling in plpgsql