Re: Working with XML. - Mailing list pgsql-sql

From George Weaver
Subject Re: Working with XML.
Date
Msg-id 005601c51825$6b430ca0$6400a8c0@Dell4500
Whole thread Raw
In response to FW: Working with XML.  (Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>)
List pgsql-sql
Hi Theo,

There have been 2 major changes between the 7 and 8 versions that affect the coding in xml2.  You need to edit the source code in order for it to compile properly on 7.

First, work_mem has to be changed to SortMem (line 666).  I.e.

    tupstore = tuplestore_begin_heap(true, false, work_mem);

should be changed to:

    tupstore = tuplestore_begin_heap(true, SortMem);

Second, the error reporting framework has changed.

To fix this, you need to change all the ereport coding to use elog.  I.e.

    ereport(ERROR, (errcode(ERRCODE_SYNTAX_ERROR),
                          errmsg("xpath_table must be called as a table function")));

should be changed to:

    elog(ERROR,"xpath_table must be called as a table function");
I have attached an edited copy of xpath.c with these changes, if you would like to work with it.
 
Regards,
George


----- Original Message -----
From: Theo Galanakis
To: 'pgsql-sql@postgresql.org'
Sent: Sunday, February 20, 2005 11:28 PM
Subject: FW: [SQL] Working with XML.


Hi,
    I have copied all the files manually from http://developer.postgresql.org/docs/pgsql/contrib/ for the xml2 contribution. However I have the following issue when I attempt to compile with gmake:

gcc -I/usr/include/libxml2 -fpic -I. -I../../src/include -D_GNU_SOURCE   -c -o xpath.o xpath.c
xpath.c: In function `xpath_table':
xpath.c:689: `work_mem' undeclared (first use in this function)
xpath.c:689: (Each undeclared identifier is reported only once
xpath.c:689: for each function it appears in.)
gmake: *** [xpath.o] Error 1

I have installed :

    libxml2-devel-2.5.10-1.rpm

What am I doing wrong, or can someone point me to the direction of a binary for XML2 on RedHat ES3, Postgres 7.4.5.

Cheers,   
    Theo
   
Attachment

pgsql-sql by date:

Previous
From: Achilleus Mantzios
Date:
Subject: Timestamp with timezone question.
Next
From: Andrew - Supernews
Date:
Subject: Re: Timestamp with timezone question.