Skip site navigation (1) Skip section navigation (2)

Re: Syntax Issue in Trigger Function??

From: <tsarevich(at)gmail(dot)com>
To: Andre Maasikas <andre(dot)maasikas(at)abs(dot)ee>,pgsql-general(at)postgresql(dot)org
Subject: Re: Syntax Issue in Trigger Function??
Date: 2004-09-29 08:54:47
Message-ID: 156a90fe040929015444a27e0@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
Cheers for that!  We did catch it eventually.  My colleague was using
pgAdminIII and was apparently typing:
v_ref := ''/'';
and pgAdminIII "appears" to have been "helping out" by escaping the
single quotes.


On Tue, 28 Sep 2004 22:46:31 +0300, Andre Maasikas
<andre(dot)maasikas(at)abs(dot)ee> wrote:
> tsarevich(at)gmail(dot)com wrote:
> > In Postgres 7.3.5 -
> > When we try to insert a new record into our parties.party table which
> > is then meant to fire off a trigger to update a column in the table
> > with some de-normalised information, we get the following error:
> > ERROR:  FLOATING POINT EXCEPTION!  The last floating point operation
> > either exceeded the legal ranges or was a divide by zero.
> >
> > Can someone help spot our syntax erorr, please?
> 
> This looks to me like a candidate:
> >               v_ref := \'\'/\'\';
> Without escaping it looks like v_ref := ''/'';
> dividing 2 empty strings, and indeed gives
> division by zero in psql. What dividing 2 strings is actually
> supposed to mean is not evident form the docs in the first glance.
> 
> >                       v_ref := \'\'/\'\' || v_parent_party_id || v_ref;
> 
> This one too.
> 
> Andre
>

In response to

pgsql-general by date

Next:From: Devrim GUNDUZDate: 2004-09-29 08:55:45
Subject: Re: About PostgreSQL's limit on arithmetic operations
Previous:From: tsarevichDate: 2004-09-29 08:34:58
Subject: Composite Type Argument Construction to a Function

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group