From: Josh Berkus <josh@agliodbs.com>
To: vernonw@gatewaytech.com
To: pgsql-sql@postgresql.org
Subject: Re: Fwd: Re: Can I search for an array in csf?
Date: Mon, 21 Oct 2002 20:02:52 -0700
Message-ID: <200210212002.52843.josh@agliodbs.com> (raw)
In-Reply-To: <UDA62BAFAQPB8JEHNI629531PJ2WC0.3db4be2b@kimiko>
References: <UDA62BAFAQPB8JEHNI629531PJ2WC0.3db4be2b@kimiko>
Vernon,
> >> One field of a table stores an array of characters in a string fromat as
> >> "a,b,c,d". Is anyway to apply a select statement without using stored
> >> procedure?
> The reason I use this format for an array is that the array is dynamic. I
have quite few cases of this type of situation. The
> maximize length in some cases is known, is unknown in others. I have learnt
the comment separated format is one way
> to solve the problem. Someone also suggested to store the array as an
object. I am not sure whether it works or not.
> The application is written in Java, by the way.
You should store this data in a sub-table linked through a foriegn key.
Period. Messing with arrays will only lead you to heartache ...
Try the book "Database Design For Mere Mortals" for a primer on SQL DB design.
--
-Josh Berkus
Aglio Database Solutions
San Francisco
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: josh@agliodbs.com, vernonw@gatewaytech.com
Subject: Re: Fwd: Re: Can I search for an array in csf?
In-Reply-To: <200210212002.52843.josh@agliodbs.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox