Re: [SQL] Tidying values on variable instantiation

2005-08-26 Thread Chris Browne
[EMAIL PROTECTED] ("Bath, David") writes: > Question(s): > * Am I being realistic, or should I grit my teeth and clone code from > trigger to trigger and column to column? > * Is this something I should try and do using domains, types and > cast functions from "text" or some horrible combinatio

Re: [SQL] Tidying values on variable instantiation

2005-08-26 Thread Chris Browne
[EMAIL PROTECTED] ("Greg Patnude") writes: > Data validation and purification should be performed at the > application layer -- you should format your data appropriately > BEFORE trying any INSERT/UPDATE operations. It seems to me that one might create some stored functions that can do some valida

Re: [SQL] Tidying values on variable instantiation

2005-08-26 Thread Bruno Wolff III
On Fri, Aug 26, 2005 at 13:04:10 +1000, > 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 "do

Re: [SQL] Tidying values on variable instantiation

2005-08-26 Thread Greg Patnude
rsday, August 25, 2005 8:04 PM To: pgsql-sql@postgresql.org Subject: [SQL] Tidying values on variable instantiation Folks, Preamble: * I can create a check constraint on a column or domain that enforces "no leading or trailing whitespace". Imagine that the domain is called "trim

Re: [SQL] Tidying values on variable instantiation

2005-08-26 Thread Russell Simpkins
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!).

Re: [SQL] Tidying values on variable instantiation

2005-08-25 Thread Michael Glaesemann
On Aug 26, 2005, at 12:04 PM, Bath, David wrote: 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 term

[SQL] Tidying values on variable instantiation

2005-08-25 Thread Bath, David
Folks, Preamble: * I can create a check constraint on a column or domain that enforces "no leading or trailing whitespace". Imagine that the domain is called "trimmed_varchar" * I can create plpgsql function/triggers that "tidy" up incoming varchars, trimming the offending whitespaces, on a