Re: SELECT substring with regex

From: T E Schmitz <mailreg(at)numerixtechnology(dot)de>
To: Aaron Bono <postgresql(at)aranya(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: SELECT substring with regex
Date: 2006-07-08 15:40:15
Message-ID: 44AFD1DF.8010102@numerixtechnology.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Aaron Bono wrote:
> On 7/7/06, *T E Schmitz* <mailreg(at)numerixtechnology(dot)de
> <mailto:mailreg(at)numerixtechnology(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Rodrigo De Leon 2006-07-08 16:48:04 Re: SELECT substring with regex
Previous Message Richard Broersma Jr 2006-07-08 15:20:22 Re: Celko's Puzzle Number 5