X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 2A42F9FA5C3 for ; Thu, 8 Jun 2006 20:09:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 41050-09 for ; Thu, 8 Jun 2006 20:09:35 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 55C409FA3CD for ; Thu, 8 Jun 2006 20:09:35 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id CE8B85648E; Thu, 8 Jun 2006 18:09:33 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Thu, 8 Jun 2006 18:09:33 -0500 Date: Thu, 8 Jun 2006 18:09:33 -0500 From: "Jim C. Nasby" To: Philippe Lang Cc: pgsql-sql@postgresql.org Subject: Re: pgxml & xpath_table Message-ID: <20060608230932.GN45331@pervasive.com> References: <6C0CF58A187DA5479245E0830AF84F421D0DB6@poweredge.attiksystem.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6C0CF58A187DA5479245E0830AF84F421D0DB6@poweredge.attiksystem.ch> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060608:philippe.lang@attiksystem.ch::nGNgpEDGWnioAu+V:000000000 0000000000000000000000004VNE X-Hashcash: 1:20:060608:pgsql-sql@postgresql.org::zYyxfjL5VOxzJk2c:0000000000000 0000000000000000000000000SLm X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/105 X-Sequence-Number: 25341 There's a good chance the author isn't on this list. You'd be better off on pgsql-general, or just emailing the author of pgxml directly. On Thu, Jun 08, 2006 at 06:00:42PM +0200, Philippe Lang wrote: > Hi, > > I'm playing with the contrib/pgxml library under PG 8.1.4, and I'm not sure if what I found with pgxml is a feature of a bug: > > I've got the following table: > > -------------------- > CREATE TABLE test > ( > id int4 NOT NULL, > xml varchar(200), > CONSTRAINT pk PRIMARY KEY (id) > ) > WITHOUT OIDS; > > INSERT INTO test VALUES (1, '123112233'); > > INSERT INTO test VALUES (2, '111222333111222333'); > -------------------- > > > If I launch this query: > > -------------------- > select * from > > xpath_table('id','xml','test', '/doc/@num|/doc/line/@num|/doc/line/a|/doc/line/b|/doc/line/c','1=1') AS t(id int4, doc_num varchar(10), line_num varchar(10), val1 int4, val2 int4, val3 int4) > > where id = 1 > > order by doc_num, line_num > -------------------- > > I get: > > -------------------- > id doc_num line_num val1 val2 val3 > 1 C1 L1 1 2 3 > 1 L2 11 22 33 > -------------------- > > I was expecting doc_num would receive twice the C1 value, just like with a normal sql join. > > Regards, > > ---------------------------------- > Philippe Lang, Ing. Dipl. EPFL > Attik System > rte de la Fonderie 2 > 1700 Fribourg > Switzerland > http://www.attiksystem.ch > > Tel: +41 (26) 422 13 75 > Fax: +41 (26) 422 13 76 -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461