Re: Tidying values on variable instantiation

From: "Russell Simpkins" <russellsimpkins(at)hotmail(dot)com>
To: <dave(dot)bath(at)unix(dot)net>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Tidying values on variable instantiation
Date: 2005-08-26 12:55:30
Message-ID: BAY103-DAV54933189A33A8FFB349D2B5AA0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Desired Outcome(s):
> * I would like to have the convenience of declaring a column that obeys
> a constraint (similar to using a domain), but allows a "tidy-up" as the
> value is created BEFORE asserting the constraint. This *might* be
> termed a "domain trigger". (Perhaps even a WORM is possible!).
> * I would like to able to declare columns as
> "trimmed_varchar(n)".
> * I'd like to be able to use the same approach for other "weak domains".

I'm not sure these any easier way to do this than with tirggers.

If the daunting task would writing a large number of triggers, I would write
sql or php to generate all the triggers. Remember that you can introspect
the db using the system catalogs. I've had a lot of good results generating
triggers and sql using Middlegen and Velocity.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Greg Patnude 2005-08-26 15:06:18 Re: Tidying values on variable instantiation
Previous Message Michael Glaesemann 2005-08-26 03:39:52 Re: Tidying values on variable instantiation