From: | "Prashant Ranjalkar" <prashant(dot)ranjalkar(at)gmail(dot)com> |
---|---|
To: | "Jasbinder Singh Bali" <jsbali(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: EXCEPTION clause not identified |
Date: | 2007-05-15 15:07:18 |
Message-ID: | ae3e48bc0705150807n2ce40fcek7fe786614a7078c5@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi,
Probably you might be using reserved words (ip_address). Please try with out
using the reserved words.
Regards
Prashant Ranjalkar
On 5/14/07, Jasbinder Singh Bali <jsbali(at)gmail(dot)com> wrote:
>
> Hi,
> In one of my trigger functions, i'm trying to catch invalid ip address
> exception
>
> CREATE OR REPLACE FUNCTION func_client_socket()
> RETURNS "trigger" AS
> $BODY$
> DECLARE
> ip_address_present int4;
> BEGIN
> ip_address_present = 1;
> SELECT inet(NEW.canonical_name);
> EXCEPTION WHEN invalid_text_representation THEN
> ip_address=0;
> END;
> $BODY$
> LANGUAGE 'plpgsql' VOLATILE;
>
> when i run this function, it gives me the followin error
>
> ERROR: syntax error at or near "EXCEPTION" at character 1343
> which is the line where I have the EXCEPTION clause.
>
> Can anyone please tell me whats going wrong here?
>
> Thanks,
> ~Jas
>
From | Date | Subject | |
---|---|---|---|
Next Message | Mr.Kraisak Kesorn | 2007-05-15 15:08:08 | I have some problems while installing PostgreSQL |
Previous Message | Prashant Ranjalkar | 2007-05-15 14:49:09 | Re: a few questions on backup |