Re: [GENERAL] Concatenating several rows with a semicolon

2010-12-28 Thread Dmitriy Igrishin
2010/12/29 Alexander Farber > Hello Dmitriy, > > I think this combination of attributes and children: > > >> >> > > >> >> > > >> >> > ... etc ... > >> >> > > > will be a good balance between size and my original problem > (combining user data and their stats in 1 chunk of information). > > A

Re: [GENERAL] Concatenating several rows with a semicolon

2010-12-28 Thread Alexander Farber
Hello Dmitriy, I think this combination of attributes and children: >> >> > >> >> >   >> >> >  ... etc ... >> >> > will be a good balance between size and my original problem (combining user data and their stats in 1 chunk of information). And I don't use JSON, because it is not natively supp

Re: [GENERAL] Concatenating several rows with a semicolon

2010-12-28 Thread Bill Moran
In response to Alexander Farber : > Hello Bill and others, > > I don't agree about yw being a bad thing > since I have weekly raings in my app, > but your XML suggestion - Do as you like, but I'll bet my reputation that decision will become an unnecessary limitation for the application at some p

Re: [GENERAL] Concatenating several rows with a semicolon

2010-12-28 Thread Dmitriy Igrishin
2010/12/29 Alexander Farber > On Tue, Dec 28, 2010 at 10:31 PM, Dmitriy Igrishin > wrote: > >> > > >> > > >> > ... etc ... > >> > > > > > Well, generally storing data in attributes should be avoided: > > > > > > > > ... > > ... > > > > ... > > > > is a better. > > Attribut

Re: [GENERAL] Concatenating several rows with a semicolon

2010-12-28 Thread Alexander Farber
On Tue, Dec 28, 2010 at 10:31 PM, Dmitriy Igrishin wrote: >> > >> >   >> >  ... etc ... >> > > > Well, generally storing data in attributes should be avoided: > > >   >     ... >     ... >   >   ... > > is a better. Attributes give me smaller size... Regards Alex -- Sent via pgsql-genera

Re: [GENERAL] Concatenating several rows with a semicolon

2010-12-28 Thread Dmitriy Igrishin
2010/12/29 Alexander Farber > Hello Bill and others, > > I don't agree about yw being a bad thing > since I have weekly raings in my app, > but your XML suggestion - > > On Tue, Dec 28, 2010 at 9:29 PM, Bill Moran > wrote: > > > > If there are multiple entries for pref_money, then each one shoul

Re: [GENERAL] Concatenating several rows with a semicolon

2010-12-28 Thread Alexander Farber
Hello Bill and others, I don't agree about yw being a bad thing since I have weekly raings in my app, but your XML suggestion - On Tue, Dec 28, 2010 at 9:29 PM, Bill Moran wrote: > > If there are multiple entries for pref_money, then each one should be > a container inside user, i.e.: > > >   >

Re: [GENERAL] Concatenating several rows with a semicolon

2010-12-28 Thread Bill Moran
In response to "Igor Neyman" : > > > > -Original Message- > > From: Alexander Farber [mailto:alexander.far...@gmail.com] > > Sent: Tuesday, December 28, 2010 10:33 AM > > To: pgsql-general@postgresql.org > > Subject: Concatenating several rows with a semicolon > > > > Hello, > > > > I

Re: [GENERAL] Concatenating several rows with a semicolon

2010-12-28 Thread Igor Neyman
> -Original Message- > From: Alexander Farber [mailto:alexander.far...@gmail.com] > Sent: Tuesday, December 28, 2010 10:33 AM > To: pgsql-general@postgresql.org > Subject: Concatenating several rows with a semicolon > > Hello, > > I'm working on a small app, which receives a list of 2

Re: [GENERAL] Concatenating several rows with a semicolon

2010-12-28 Thread Dmitriy Igrishin
2010/12/28 Dmitriy Igrishin > > > 2010/12/28 Alexander Farber > > Hello, >> >> I'm working on a small app, which receives a list of 20 players in XML >> format. >> >> The initial version works ok and I use there just 1 SQL statement and thus >> it is easy for me to fetch results row by row and p

Re: [GENERAL] Concatenating several rows with a semicolon

2010-12-28 Thread Dmitriy Igrishin
2010/12/28 Alexander Farber > Hello, > > I'm working on a small app, which receives a list of 20 players in XML > format. > > The initial version works ok and I use there just 1 SQL statement and thus > it is easy for me to fetch results row by row and print XML at the same > time: > >

Re: [GENERAL] Concatenating several rows with a semicolon

2010-12-28 Thread Gary Chambers
Alex, create or replace function pref_money_stats(_id varchar) returns varchar as $BODY$ begin declare stats varchar; for row in select yw, money from pref_money where id=_id order by yw desc limit 20 loop stats := stats || ";" || row.id || ":" || row

Re: [GENERAL] Concatenating several rows with a semicolon

2010-12-28 Thread Alexander Farber
I'm trying: create or replace function pref_money_stats(_id varchar) returns varchar as $BODY$ begin declare stats varchar; for row in select yw, money from pref_money where id=_id order by yw desc limit 20 loop stats := stats || ";" || row.id || "

[GENERAL] Concatenating several rows with a semicolon

2010-12-28 Thread Alexander Farber
Hello, I'm working on a small app, which receives a list of 20 players in XML format. The initial version works ok and I use there just 1 SQL statement and thus it is easy for me to fetch results row by row and print XML at the same time: select u.id,