Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 42721476101 for ; Mon, 21 Oct 2002 22:56:39 -0400 (EDT) Received: from pd3mo3so.prod.shaw.ca (shawidc-mo1.cg.shawcable.net [24.71.223.10]) by postgresql.org (Postfix) with ESMTP id 418DD476121 for ; Mon, 21 Oct 2002 22:56:38 -0400 (EDT) Received: from pd2mr3so.prod.shaw.ca (pd2mr3so-ser.prod.shaw.ca [10.0.141.108]) by l-daemon (iPlanet Messaging Server 5.1 HotFix 0.8 (built May 12 2002)) with ESMTP id <0H4D007ES46285@l-daemon> for pgsql-sql@postgresql.org; Mon, 21 Oct 2002 20:56:26 -0600 (MDT) Received: from pn2ml8so.prod.shaw.ca (pn2ml8so-qfe0.prod.shaw.ca [10.0.121.152]) by l-daemon (iPlanet Messaging Server 5.1 HotFix 0.8 (built May 12 2002)) with ESMTP id <0H4D005OP462Z1@l-daemon> for pgsql-sql@postgresql.org; Mon, 21 Oct 2002 20:56:26 -0600 (MDT) Received: from kimiko (h24-78-132-76.vc.shawcable.net [24.78.132.76]) by l-daemon (iPlanet Messaging Server 5.1 HotFix 0.8 (built May 12 2002)) with SMTP id <0H4D002NK461XH@l-daemon> for pgsql-sql@postgresql.org; Mon, 21 Oct 2002 20:56:26 -0600 (MDT) Date: Mon, 21 Oct 2002 19:55:39 -0700 From: Vernon Wu Subject: Fwd: Re: Can I search for an array in csf? To: pgsql-sql@postgresql.org Reply-To: vernonw@gatewaytech.com Message-id: MIME-version: 1.0 X-Mailer: Opera 6.05 build 1140 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7BIT X-Priority: 3 (Normal) X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/267 X-Sequence-Number: 9984 Hi, Richard, Thanks for your response and see below. 10/21/2002 3:13:57 AM, Richard Huxton wrote: >On Friday 18 Oct 2002 1:58 pm, Vernon Wu wrote: >> 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? >> >> Thanks for your input. > >Not really, and I can't think any way of accessing an index on this either. >Are you sure you wanted the characters stored this way? Even if the overhead >of a separate table isn't woth it, you might want to look into arrays and the >intarray stuff in contrib/ > 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. I have taken a look at intarray by searching on the postgres.org web site as well as in google. (I use cypwin and unable to find the contrib directory). My impression is it isn't a standard SQL data type. And its element is integer only. It is my first time doing DB table design. Any helps will be gracfully appreciated. Thanks, Vernon >-- > Richard Huxton > >---------------------------(end of broadcast)--------------------------- >TIP 3: if posting/reading through Usenet, please send an appropriate >subscribe-nomail command to majordomo@postgresql.org so that your >message can get through to the mailing list cleanly > -------- End of forwarded message --------