Re: [GENERAL] select from pipe-delimited field - Mailing list pgsql-novice

From hubert depesz lubaczewski
Subject Re: [GENERAL] select from pipe-delimited field
Date
Msg-id 20100824113755.GC29066@depesz.com
Whole thread Raw
In response to Re: [GENERAL] select from pipe-delimited field  (san man <neelakash21@gmail.com>)
List pgsql-novice
On Mon, Aug 23, 2010 at 06:07:08PM -0500, san man wrote:
> Thanks for the replies.
> David, I would have normalized it to 2 or more tables, but the number of
> bar-delimited are not fixed and as new data are added the maximum number of
> these values may change. Also, the problem with like I think is that
> matching is not strict and thus might give spurious hits.

The fact that it's not fixed is irrelevant. just add table:

create table synonyms (
    word text,
    synonym text,
    primary key (synonymi, word)
);

and you're fine. you can have as many synonyms per word as you want.

depesz


pgsql-novice by date:

Previous
From: solaimurugan v
Date:
Subject: RESTORE DATABASE BACKUP TO MODIFIED DATABASE
Next
From: Florian Henge
Date:
Subject: Re: xml output