Re: Foreign Key for PHP serialized data - possible?

From: Erik Jones <erik(at)myemma(dot)com>
To: Michael Glaesemann <grzm(at)seespotcode(dot)net>
Cc: "Dave" <withheld(at)nospam(dot)thanks>, pgsql-general(at)postgresql(dot)org
Subject: Re: Foreign Key for PHP serialized data - possible?
Date: 2007-10-08 17:59:16
Message-ID: F6C686FC-7059-49A2-AED5-B6AEBDDA5B23@myemma.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Oct 8, 2007, at 12:08 PM, Michael Glaesemann wrote:

>
> On Oct 8, 2007, at 8:33 , Dave wrote:
>
>> I guess, I can always
>> set up views with joins, but could not come up with a good way to
>> query this
>> in a one returned row, e.g.:
>> ID | Name | colors | fav_col | kind
>> | fav_kind | etc.
>> 11 | Apples | red, green, etc. | red | Granny smith, Golden
>> delicious.. | Granny smith | etc.
>
> You can either do it in your middleware or use array_accum.
>
> http://www.postgresql.org/docs/8.2/static/xaggr.html
>
> The archives have examples of doing things like this.
>
> Note that *this* is the problem you're trying to solve, not the
> serialization issue you're having above. I recommend changing your
> schema.

I, also, agree. The "problem" you're trying to avoid with having
separate tables for colors, kinds, etc. is exactly what a relational
database is for.

Erik Jones

Software Developer | Emma®
erik(at)myemma(dot)com
800.595.4401 or 615.292.5888
615.292.0777 (fax)

Emma helps organizations everywhere communicate & market in style.
Visit us online at http://www.myemma.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Oleg Bartunov 2007-10-08 18:02:38 Re: How to make LIKE to use index in "abc%" query?
Previous Message Scott Marlowe 2007-10-08 17:27:43 Re: Request: Anyone using bogus / "humorous" X-Message-Flag headers, could we please turn them off