Re: abs() does not exists.. - Mailing list pgsql-general

From Rob Arnold
Subject Re: abs() does not exists..
Date
Msg-id 001801c0f462$8acd5a20$4901010a@canrion.net
Whole thread Raw
In response to abs() does not exists..  ("mazzo" <jambo@aruba.it>)
List pgsql-general
How about a trigger/function that does this:

if val < 0 then val = val * -1

--rob

----- Original Message -----
From: "Bruno Wolff III" <bruno@wolff.to>
To: "Peter Eisentraut" <peter_e@gmx.net>
Cc: "mazzo" <jambo@aruba.it>; <pgsql-general@postgresql.org>
Sent: Wednesday, June 13, 2001 10:45 AM
Subject: Re: abs() does not exists..


> On Wed, Jun 13, 2001 at 12:11:42AM +0200,
>   Peter Eisentraut <peter_e@gmx.net> wrote:
> > mazzo writes:
> >
> > > Hi all..i'm trying to create a trigger that fires before i insert a
value into a column and if the value i insert is negative, it will change it
to positive...
>
> Couldn't you do this using a rule to update the table and a constraint on
> the table to prevent bad data from getting into the table without using
the
> rule?
>


pgsql-general by date:

Previous
From: Nicolas Huillard
Date:
Subject: VARCHAR to CIDR type cast : external function for 6.5
Next
From: Tom Lane
Date:
Subject: Re: problem connecting from another host