Re: function return value inside a trigger function

From: Bosco Rama <postgres(at)boscorama(dot)com>
To: joao viegas <jtamviegas(at)yahoo(dot)co(dot)uk>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: function return value inside a trigger function
Date: 2012-09-27 01:07:46
Message-ID: 5063A6E2.1020609@boscorama.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 09/26/12 17:56, joao viegas wrote:
>
> does anybody knows how can I have something like:
> select function_that_returns_int(NEW.field1) into NEW.field2;

I think you want:
select into NEW.field2 function_that_returns_int(NEW.field1);

or even:
NEW.field2 := function_that_returns_int(NEW.field1);

Bosco.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2012-09-27 01:15:35 Re: PostgreSQL, OLAP, and Large Clusters
Previous Message joao viegas 2012-09-27 00:56:00 function return value inside a trigger function