Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 625F2CE2ABF for ; Sat, 21 Jan 2012 11:44:21 -0400 (AST) Received: from smtp107.prem.mail.ac4.yahoo.com ([76.13.13.46]) by makus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Rod73-000415-13 for pgsql-admin@postgresql.org; Sat, 21 Jan 2012 15:44:21 +0000 Received: (qmail 2778 invoked from network); 21 Jan 2012 15:44:04 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=DKIM-Signature:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Content-Type:X-Mailer:Thread-Index:Content-Language; b=kfDMTq4vUuEVJ6lCVIW0mRp/4YBZt97cTj7r5psKWM48BLh90P74JPPg2yvtl/xY8AGnueE3Y0vJ8dsdjBOXrkM7oFc2Mf1+jPXcW0VR4epphdVMJ9Y3QYk707562lO6jXD3a0OZ8zQq0ZpoOcTH1owBe1oV+l97TtIvRBuXHbo= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1327160644; bh=167CyqnI2tse7zEh0oZ2536o1l2FzzZBy+a271JyL8w=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Content-Type:X-Mailer:Thread-Index:Content-Language; b=usuYUtKPvTFCuETOzPCImCv4F2jtY4d1zlNmoDMa/KyAWeL16Lp6Nhla+Jhy0vD3VOS66Kr/3zO+vrWMItDhvDX73Io8ywX16ve+xRjKxaZGkGpFKHcwFRKi++jAhJrnZLkmqfgXspcEYW+/epLkp1Y2YkUfa6Ggi3iebedBf4A= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: nfuvz5MVM1lSakiAmrjV.Ccp396Sm6fMxcheg5dCura9ZnG 2TDsBE_lSA2cjS0eFWyNHelL31C8499rqVwWsUzfC3A8BOFc7NSDiWFneG6x 0sV2p8k.AXzfDC8G7fRO4xPrNmdiznPARKCR5Nv7pWcyFbk_AV1DYjQ.NZHP Z8KEsjrvwjWuU9qLs6WEqG7JZaW._9XB36q25om71NArm.837pG0NKuNUpgf F_TcXEyY6di0kcdJBZ7QWsZ.y640cZ4nFGv9WfqcntzS5KuxrZe_PCQBqkjN _gnnopCuo7RTawhDkVOcez6p6zfxlm2nMYUGeTxYoACVaYtHJerN0U4tybpe kgrTnqKZA4qeF7UKbGyJC9E1Eo21Ez6akY_1Y3dqS4au0s4Ag_OZ8SLQfxn7 dq8BiE9uSeyrqMcMxzv_5 X-Yahoo-SMTP: mpGJl6eswBD2IBufoVEg0Pa8gg-- Received: from WolfDog (polobo@24.93.23.188 with login) by smtp107.prem.mail.ac4.yahoo.com with SMTP; 21 Jan 2012 07:44:03 -0800 PST From: "David Johnston" To: "'c k'" , "'pgsql-admin'" , References: In-Reply-To: Subject: Re: [GENERAL] grouping of query data in xml Date: Sat, 21 Jan 2012 10:43:56 -0500 Message-ID: <002b01ccd853$7cc0b130$76421390$@yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_002C_01CCD829.93EC56E0" X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQIpDzU9QxH5BLpN+0vu9urd/orGDJVehmfA Content-Language: en-us X-Pg-Spam-Score: 0.0 (/) X-Archive-Number: 201201/125 X-Sequence-Number: 39037 This is a multipart message in MIME format. ------=_NextPart_000_002C_01CCD829.93EC56E0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: pgsql-general-owner@postgresql.org = [mailto:pgsql-general-owner@postgresql.org] On Behalf Of c k Sent: Saturday, January 21, 2012 10:23 AM To: pgsql-admin; pgsql-general@postgresql.org Subject: [GENERAL] grouping of query data in xml =20 Hi friends, I am working with some xml exporting functionality of our application. I = am testing query_to_xml function supported in PostgreSQL 9.1. XML output = should be=20 1 COMPANY ACCOUNT 638168 10000.0000 0.0000 638168 0.0000 10000.0000 but the output is as follows: acc group 1 COMPANY ACCOUNT docs 638168 10000.0000 0.0000 acc group 1 COMPANY ACCOUNT docs 638168 0.0000 10000.0000 How can grouping on specific columns can be done in result xml through = using query_to_xml? I am expecting help from postgresql community as always. Thanks CPKulkarni =20 Maybe provide the query you are trying to execute=E2=80=A6? Also, you should not post to multiple lists. This is NOT an = administration issue so you should not have included pgsql-admin. Given that tables/query-results are two-dimensional why is it that you = expect to have child elements? Are you claiming the output is = wrong or simply that you would like a different output than what you are = being given? David J. ------=_NextPart_000_002C_01CCD829.93EC56E0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

From:= = pgsql-general-owner@postgresql.org = [mailto:pgsql-general-owner@postgresql.org] On Behalf Of c = k
Sent: Saturday, January 21, 2012 10:23 AM
To: = pgsql-admin; pgsql-general@postgresql.org
Subject: [GENERAL] = grouping of query data in xml

 

Hi friends,

I am working with some xml = exporting functionality of our application. I am testing query_to_xml = function supported in PostgreSQL 9.1. XML output should be =
 <accgroup>

  = <accgroupid>1</accgroupid>
  = <accgroupname>COMPANY = ACCOUNT</accgroupname>

 <docs>

  = <refaccdocid>638168</refaccdocid>
  = <debit>10000.0000</debit>
  = <credit>0.0000</credit>

 </docs>
 <docs>=

 <refaccdocid>638168</refaccdoci= d>
  <debit>0.0000</debit>
  = <credit>10000.0000</credit>

  = </docs>

</accgroup>

but the output is as = follows:
<row>
  <accgroup>acc = group</accgroup>
  = <accgroupid>1</accgroupid>
  = <accgroupname>COMPANY ACCOUNT</accgroupname>
  = <docs>docs</docs>
  = <refaccdocid>638168</refaccdocid>
  = <debit>10000.0000</debit>
  = <credit>0.0000</credit>
</row>

<row>  <accgroup>acc group</accgroup>
  = <accgroupid>1</accgroupid>
  = <accgroupname>COMPANY ACCOUNT</accgroupname>
  = <docs>docs</docs>
  = <refaccdocid>638168</refaccdocid>
  = <debit>0.0000</debit>
  = <credit>10000.0000</credit>
</row>

How can = grouping on specific columns can be done in result xml through using = query_to_xml?
I am expecting help from postgresql community as = always.

Thanks

CPKulkarni

 

Maybe provide the query you are trying to = execute=E2=80=A6?

Also, you should not post to multiple lists.=C2=A0 This is NOT an = administration issue so you should not have included = pgsql-admin.

Given that tables/query-results are two-dimensional why is it that = you expect <docs> to have child elements?=C2=A0 Are you claiming = the output is wrong or simply that you would like a different output = than what you are being given?

David J.

------=_NextPart_000_002C_01CCD829.93EC56E0--