Re: Rounding in PGSQL

From: Mike Nolan <nolan(at)gw(dot)tssi(dot)com>
To: konference(at)menea(dot)cz (Jiri Nemec)
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Rounding in PGSQL
Date: 2004-08-07 15:00:11
Message-ID: 200408071500.i77F0C8V030115@gw.tssi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Is there some possibility how to write own PGSQL function which I pass in
> price, function selects correct value from "rounding" column and
> return rounded value?

It's unclear whether you want to store the value in its original form
or in its rounded form.

If the latter, what you need is an 'on insert or update' trigger which
passes the value being inserted or updated through your rounding
function and stores the rounded value.
--
Mike Nolan

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2004-08-07 17:21:47 Re: Rounding in PGSQL
Previous Message Jan Wieck 2004-08-07 14:24:34 Re: Updateable Views?