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

numericOnly trigger

From: Derrick Betts <list(at)blueaxis(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: numericOnly trigger
Date: 2007-09-21 16:03:24
Message-ID: 46F3EB4C.1040305@blueaxis.com (view raw or flat)
Thread:
Lists: pgsql-novice
I was wondering if anyone has built a trigger or etc. that verifies the 
validity of an entry that is being posted to the database. I would like 
to do the following:
    1.    Iterate through the column types in the table being updated
    2.    If the column type is numeric or real, or etc.,
        a. remove all the strings from the New.value
        b. set the New.value to the newly stripped value
     3.    Update the table with the modified values.

The part I was hoping not to have to reproduce, if anyone has it and is 
willing to share it, is the logic for iterating through the column types 
and cleaning the specific values for update.

Thanks,
Derrick


Responses

pgsql-novice by date

Next:From: Sean DavisDate: 2007-09-21 17:31:27
Subject: Re: numericOnly trigger
Previous:From: Oliver ElphickDate: 2007-09-21 08:45:37
Subject: Re: inheritance is madness

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