pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Russell Simpkins <russellsimpkins@hotmail.com>
To: dave.bath@unix.net
To: pgsql-sql@postgresql.org
Subject: Re: Tidying values on variable instantiation
Date: Fri, 26 Aug 2005 08:55:30 -0400
Message-ID: <BAY103-DAV54933189A33A8FFB349D2B5AA0@phx.gbl> (raw)
References: <200508261304.10542.dave.bath@unix.net>

> 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.



view thread (7+ messages)  latest in thread

Message-ID: <BAY103-DAV54933189A33A8FFB349D2B5AA0@phx.gbl>
Permalink:  ../BAY103-DAV54933189A33A8FFB349D2B5AA0@phx.gbl/
Also on:    postgresql.org/message-id/BAY103-DAV54933189A33A8FFB349D2B5AA0@phx.gbl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: russellsimpkins@hotmail.com, dave.bath@unix.net
  Subject: Re: Tidying values on variable instantiation
  In-Reply-To: <BAY103-DAV54933189A33A8FFB349D2B5AA0@phx.gbl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox