Re: select from pipe-delimited field

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: san man <neelakash21(at)gmail(dot)com>
Cc: Arjen Nienhuis <a(dot)g(dot)nienhuis(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org, pgsql-novice(at)postgresql(dot)org
Subject: Re: select from pipe-delimited field
Date: 2010-08-24 11:37:55
Message-ID: 20100824113755.GC29066@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Pirotte 2010-08-24 18:37:33 subscribe
Previous Message Scott Marlowe 2010-08-24 05:47:35 Re: select from pipe-delimited field

Browse pgsql-novice by date

  From Date Subject
Next Message Florian Henge 2010-08-25 08:53:04 Re: xml output
Previous Message solaimurugan v 2010-08-24 11:32:28 RESTORE DATABASE BACKUP TO MODIFIED DATABASE