Received: from mustang.sdc.com.au (mustang.sdc.com.au [203.2.199.1]) by hub.org (8.9.3/8.9.3) with ESMTP id EAA89560 for ; Sat, 4 Dec 1999 04:32:31 -0500 (EST) (envelope-from scldad@mustang.sdc.com.au) Received: from mustang.sdc.com.au (localhost [127.0.0.1]) by mustang.sdc.com.au (8.9.1a/8.9.1) with ESMTP id UAA01301; Sat, 4 Dec 1999 20:01:58 +1030 Message-Id: <199912040931.UAA01301@mustang.sdc.com.au> X-Mailer: exmh version 2.0.3 3/23/99 To: Peter Eisentraut cc: pgsql-sql@postgreSQL.org, Marcin Mazurek - Multinet SA - Poznan Subject: Re: [SQL] arrays In-Reply-To: Message from Peter Eisentraut of "Sat, 04 Dec 1999 03:23:30 BST." Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Date: Sat, 04 Dec 1999 20:01:58 +1030 From: Stephen Davies Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.org id EAA89574 Arrays do have a role in life: even in a "proper relational" world. The classical examples are publications with multiple authors, ISBns, subjects, keywords etc. Trying to fully normalise attributes like these leads to nonsensical and unusable database designs. Cheers, Stephen. Peter Eisentraut wrote: > Don't use arrays. They look very promising but they aren't. Most of these > kind of questions can be resolved by designing a proper relational > database schema. > > On 1999-12-01, Marcin Mazurek - Multinet SA - Poznan mentioned: > > > Hi, > > I have a table: orders (id int, val INT4[][]);. The question is how to > > select in separate rows values from particular id? > > > > example: > > insert into orders values(1,'{{1,1},{1,4},{2,3}}'); > > select val from orders where id=1; gives me: > > val > > ------------------- > > {{1,2},{1,4},{2,3}} > > > > How can I make from it to columned table with first and second int > > separated? > > > > mazek > > > > > > > > ************ > > > > > > -- > Peter Eisentraut Sernanders väg 10:115 > peter_e@gmx.net 75262 Uppsala > http://yi.org/peter-e/ Sweden > > > > ************ -- ======================================================================== Stephen Davies Consulting scldad@sdc.com.au Adelaide, South Australia. Voice: 08-8177 1595 Computing & Network solutions. Fax: 08-8177 0133