From: Carlo Vitolo <carlino@ilrspa.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: Problem with function & trigger
Date: Mon, 09 Jul 2001 23:05:33 +0200
Message-ID: <3B4A1C9C.A1A06DD4@ilrspa.com> (raw)
References: <3B46ED17.9F3EACA4@ilrspa.com>
<29529.994534086@sss.pgh.pa.us>
Tom Lane wrote:
> Carlo Vitolo <carlino@ilrspa.com> writes:
> > This does not work. The error is ERROR: pg_atoi: error in "12.00": can't
> > parse ".00"
>
> What PG version are you running? It seems to work fine for me in
> current sources:
>
>
Ver. 7.1.2
>
> BTW, the way you are writing the functions seems bizarrely inefficient.
> Why not just:
>
> CREATE FUNCTION "togliscar" () RETURNS opaque AS 'BEGIN
> UPDATE magazzino
> SET quantita = quantita - NEW.quantita
> WHERE descrizione = NEW.descrizione;
> RETURN NEW;
> END;
> ' LANGUAGE 'plpgsql';
>
> regards, tom lane
Yes is better thanks!
You are right it works perfectly. It was my fault. I had another trigger on
insert and this function used an incorrect type of variable.
By the way. Is there a way to have an error message like "ERROR xxx in
Function xxx "?.
Bye!
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: carlino@ilrspa.com, tgl@sss.pgh.pa.us
Subject: Re: Problem with function & trigger
In-Reply-To: <3B4A1C9C.A1A06DD4@ilrspa.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox