Re: SELECT substring with regex - Mailing list pgsql-sql

From T E Schmitz
Subject Re: SELECT substring with regex
Date
Msg-id 44AFD1DF.8010102@numerixtechnology.de
Whole thread Raw
In response to Re: SELECT substring with regex  ("Aaron Bono" <postgresql@aranya.com>)
List pgsql-sql
Aaron Bono wrote:
> On 7/7/06, *T E Schmitz* <mailreg@numerixtechnology.de 
> <mailto:mailreg@numerixtechnology.de>> wrote:
> 
> 
>     I am trying to come up with a semi-automatic solution to tidy up some
>     data. If it's got to be done manually via the GUI it would mean a lot of
>     dummy work [for the customer].
> 
> 
> I would recommend you alter the GUI to NOT allow any more bad data to 

I absolutely agree that the user should not be able to enter 'bad' data 
in the first place.
However, in this case it is not a hard and fast rule, rather a 
suggestion how to organize the data sensibly. The pattern is suitable 
for 98% of the lenses; there are some, albeit very few, exceptions.

Also: the MODEL.NAME is a free-form field; only when referred to by a 
PRODUCT which is of CATEGORY 'Lens', would the pattern apply.

The only way one could maybe assist the user would be a warning when he 
tries to save a 'Lens' PRODUCT, which deviates from the pattern.

> You might also consider adding the base and suffix columns with a 
> trigger that parses the name field and sets the values of base and 
> suffix and also does any integrity checks during inserts and updates.  
> Finally, after the data is cleaned up and the client apps are changed to 
> use base and suffix and not name, get rid of the name column.

The suffix should have been entered in TYPE.NAME, which references 
MODEL. The structure exists, it just needs to be used efficiently.

-- 


Regards,

Tarlika


pgsql-sql by date:

Previous
From: Richard Broersma Jr
Date:
Subject: Re: Celko's Puzzle Number 5
Next
From: "Rodrigo De Leon"
Date:
Subject: Re: SELECT substring with regex