Re: [SQL] [GENERAL] arrays

2002-10-07 Thread scott.marlowe
On Sun, 29 Sep 2002, Mike Sosteric wrote: > On Sun, 29 Sep 2002, Bruce Momjian wrote: > > Apologies in advance if there is a more appropriate list. > > We are currently developing a database to host some complicated, XMl > layered data. We have chosen postgres because of its ability to store >

Re: [SQL] [GENERAL] arrays

2002-10-01 Thread Josh Berkus
Achilleus, > I was wondering why is such a rage against arrays. > > I posted 2 very common problems where arrays provide > the only natural (and efficient) fit. (and got no responses) > So it seems to me that: All of your points are correct. Us "old database hands" have a knee-jerk reaction

Re: [SQL] [GENERAL] arrays

2002-10-01 Thread Roland Roberts
> "Josh" == Josh Berkus <[EMAIL PROTECTED]> writes: Josh> Now, I know at least one person who is using arrays to store Josh> scientific data. However, that data arrives in his lab in Josh> the form of matrices, and is not used for joins or query Josh> criteria beyond a simple

Re: [SQL] [GENERAL] arrays

2002-10-01 Thread Achilleus Mantzios
I was wondering why is such a rage against arrays. I posted 2 very common problems where arrays provide the only natural (and efficient) fit. (and got no responses) So it seems to me that: - Arrays implementation (along with the intarray package) in postgresql is well performing and stable. -

Re: [SQL] [GENERAL] arrays

2002-09-30 Thread Mike Sosteric
On Mon, 30 Sep 2002, Josh Berkus wrote: > > Question #1: If each record has 67 fields, and each field may appear in > several languages, is it possible for some fields to be in more languages > than others? I.e. if "title-en" and "title-de" exist, does it follow that > "content-en" and "con

Re: [SQL] [GENERAL] arrays

2002-09-30 Thread Josh Berkus
Mike, > has an language attribute. if there are, say 67 seperate items, each with > multiple languages, then the comlexity of the table structure skyrockets > because you have to allow for multiple titles, multiple names, multiple > everything. This looks soluable several ways. Question #1

Re: [SQL] [GENERAL] arrays

2002-09-30 Thread Mike Sosteric
On Mon, 30 Sep 2002, Josh Berkus wrote: Don't worry. Our biggest problem is that each XML data entry, say This is the title has an language attribute. if there are, say 67 seperate items, each with multiple languages, then the comlexity of the table structure skyrockets because you have to a

Re: [SQL] [GENERAL] arrays

2002-09-30 Thread Josh Berkus
Mike, > thanks for this. we will stick with the relational model. Hey, don't make your decision entirely based on my advice.Do some research! I'm just responding "off the cuff" to your questions. If you do take the relational approach, post some sample problems here and people can help

Re: [SQL] [GENERAL] arrays

2002-09-30 Thread Mike Sosteric
On Mon, 30 Sep 2002, Josh Berkus wrote: thanks for this. we will stick with the relational model. m > > Mike, > > > I have a very good sense of the strengths of relational databases. But > > they are also limited when it comes to object orientaed data (like XML > > records). I though arrays

Re: [SQL] [GENERAL] arrays

2002-09-30 Thread Josh Berkus
Mike, > I have a very good sense of the strengths of relational databases. But > they are also limited when it comes to object orientaed data (like XML > records). I though arrays would be a way to simply the complexity you get > when you try and map objects to relations. In my experience, mos

Re: [SQL] [GENERAL] arrays

2002-09-30 Thread Mike Sosteric
On Mon, 30 Sep 2002, Josh Berkus wrote: I have a very good sense of the strengths of relational databases. But they are also limited when it comes to object orientaed data (like XML records). I though arrays would be a way to simply the complexity you get when you try and map objects to relation

Re: [SQL] [GENERAL] arrays

2002-09-30 Thread Josh Berkus
Dan, > Just in case you or others think Josh is some crazed lunatic[1] who > doesn't know what he's talking about, I support his views on this > topic. Avoid arrays. Normalize your data. And just because I'm a crazed lunatic, that doesn't mean that I don't know what I'm talking about. Um.

Re: [SQL] [GENERAL] arrays

2002-09-30 Thread Dan Langille
On 30 Sep 2002 at 12:09, Bruce Momjian wrote: > Dan Langille wrote: > > On 30 Sep 2002 at 8:54, Josh Berkus wrote: > > > > > As such, I'd reccommend one of two approaches for you: > > > > > > 1) Post some of your schema ideas here, and let us show you how they > > > are better done relationally

Re: [SQL] [GENERAL] arrays

2002-09-30 Thread Bruce Momjian
Dan Langille wrote: > On 30 Sep 2002 at 8:54, Josh Berkus wrote: > > > As such, I'd reccommend one of two approaches for you: > > > > 1) Post some of your schema ideas here, and let us show you how they > > are better done relationally. The relational data model has 30 years > > of thought beh

Re: [SQL] [GENERAL] arrays

2002-09-30 Thread Dan Langille
On 30 Sep 2002 at 8:54, Josh Berkus wrote: > As such, I'd reccommend one of two approaches for you: > > 1) Post some of your schema ideas here, and let us show you how they > are better done relationally. The relational data model has 30 years > of thought behind it -- it can solve a lot of pr

Re: [SQL] [GENERAL] arrays

2002-09-30 Thread Josh Berkus
Mike, > We are currently developing a database to host some complicated, XMl > layered data. We have chosen postgres because of its ability to store > multidimensional arrays. We feel that using these will allow us to > simplify the database structure considerably by storing some data in > multid

Re: [SQL] [GENERAL] arrays

2002-09-30 Thread Tom Lane
Mike Sosteric <[EMAIL PROTECTED]> writes: > could you select where title[0] = 'en' You certainly could ... but bear in mind that there's no convenient way to make such a query be indexed, at present. So any values that you actually want to use as search keys had better be in their own fields. N

Re: [SQL] [GENERAL] arrays

2002-09-30 Thread Bruno Wolff III
On Mon, Sep 30, 2002 at 06:38:56 -0600, Mike Sosteric <[EMAIL PROTECTED]> wrote: > On Mon, 30 Sep 2002, Bruno Wolff III wrote: > > The chances are very very good that in 99% of the cases we'd only ever > have a single title. multiple titles would be rare. and, to make it worse, > there are seve

Re: [SQL] [GENERAL] arrays

2002-09-30 Thread Achilleus Mantzios
On Mon, 30 Sep 2002, Bruno Wolff III wrote: > > It is unusual to want to store arrays in a database. Normally you want to > use additional tables instead. For example multilanguage titles is something > I would expect to be in a table that had a column referencing back to > another table defining

Re: [SQL] [GENERAL] arrays

2002-09-30 Thread Mike Sosteric
On Mon, 30 Sep 2002, Bruno Wolff III wrote: > > 3) can you do selects on only a portion of a multidimensional array. That > > is, if you were storing multilanguage titles in a two dimensional array, > > > > [en], "english title" > > [fr], "french title" > > > > could you select where title[0]

Re: [SQL] [GENERAL] arrays

2002-09-30 Thread Bruno Wolff III
On Sun, Sep 29, 2002 at 18:12:55 -0600, Mike Sosteric <[EMAIL PROTECTED]> wrote: > On Sun, 29 Sep 2002, Bruce Momjian wrote: > > 3) can you do selects on only a portion of a multidimensional array. That > is, if you were storing multilanguage titles in a two dimensional array, > > [en], "engl

Re: [SQL] [GENERAL] arrays

2002-09-29 Thread Mike Sosteric
On Sun, 29 Sep 2002, Bruce Momjian wrote: Apologies in advance if there is a more appropriate list. We are currently developing a database to host some complicated, XMl layered data. We have chosen postgres because of its ability to store multidimensional arrays. We feel that using these will a