pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexandre <ultrago@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: BUG #5859: XML result in line and column
Date: Tue, 1 Feb 2011 15:20:51 GMT
Message-ID: <201102011520.p11FKpLt022295@wwwmaster.postgresql.org> (raw)


The following bug has been logged online:

Bug reference:      5859
Logged by:          Alexandre
Email address:      ultrago@gmail.com
PostgreSQL version: 8.4.7
Operating system:   Windows 7
Description:        XML result in line and column
Details: 

The name of the xml tag is not being updated, becoming the first name
registry for all. Here is example:

Create table AUDITORIA_ANTERIOR
(
    SEQUENCIA Serial NOT NULL,
    SEQUENCIA_AUDITORIA Integer NOT NULL,
    REGISTRO Text NOT NULL,
primary key (SEQUENCIA,SEQUENCIA_AUDITORIA)
);
 
insert into auditoria_anterior (sequencia_auditoria, registro)
values (1, '<?xml version="1.0" encoding="iso-8859-1"?><ROOT>
<CLIENTES><CGC_CPF_CLIENTE>12345678901</CGC_CPF_CLIENTE><TIPO>1</TIPO><CODIG
O_CONVENIO></CODIGO_CONVENIO><PESSOA>F</PESSOA><NOME>JOAO DA
SILVA</NOME></CLIENTES> </ROOT>')
 
SELECT * FROM
xpath_table('sequencia',
            'registro',
            'auditoria_anterior',
            'name(/ROOT/CLIENTES/*)|/ROOT/CLIENTES/*',
            'sequencia = 1')
AS t(sequencia integer, coluna text, valor text)

--Incorrect result-----------------------------------
sequencia   coluna            valor
integer     text              text
--------------------------------------------------
1           CGC_CPF_CLIENTE   12345678901
1           CGC_CPF_CLIENTE   1
1           CGC_CPF_CLIENTE   F
1           CGC_CPF_CLIENTE   JOAO DA SILVA


--Result that would be right to be presented----------
sequencia   coluna            valor
integer     text              text
--------------------------------------------------
1           CGC_CPF_CLIENTE   12345678901
1           TIPO              1
1           PESSOA            F
1           NOME              JOAO DA SILVA



view thread (3+ messages)  latest in thread

Message-ID: <201102011520.p11FKpLt022295@wwwmaster.postgresql.org>
Permalink:  ../201102011520.p11FKpLt022295@wwwmaster.postgresql.org/
Also on:    postgresql.org/message-id/201102011520.p11FKpLt022295@wwwmaster.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: ultrago@gmail.com
  Subject: Re: BUG #5859: XML result in line and column
  In-Reply-To: <201102011520.p11FKpLt022295@wwwmaster.postgresql.org>
  References: <201102011520.p11FKpLt022295@wwwmaster.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox