Build PostgreSQL With XML Support on Linux

Started by Osahon Oduwarealmost 9 years ago7 messagesgeneral
Jump to latest
#1Osahon Oduware
osahon.gis@gmail.com

Hi All,

I successfully built PostgreSQL from source on Linux (Centos 7) using the
following:
./configure --prefix=/home/nagispg/local/pgsql --with-libxml --with-libxslt

Prior to this I had installed the xml and xslt packages (amongst others)
using:
yum install libxml2-devel
yum install libxslt-devel

However, when I try to store XML data in a table I get an error. The log
file states that I need to rebuild PostgreSQL with --with-libxml.

When I run pg_config I get the following output:
BINDIR = /home/nagispg/local/pgsql/bin
DOCDIR = /home/nagispg/local/pgsql/share/doc
HTMLDIR = /home/nagispg/local/pgsql/share/doc
INCLUDEDIR = /home/nagispg/local/pgsql/include
PKGINCLUDEDIR = /home/nagispg/local/pgsql/include
INCLUDEDIR-SERVER = /home/nagispg/local/pgsql/include/server
LIBDIR = /home/nagispg/local/pgsql/lib
PKGLIBDIR = /home/nagispg/local/pgsql/lib
LOCALEDIR = /home/nagispg/local/pgsql/share/locale
MANDIR = /home/nagispg/local/pgsql/share/man
SHAREDIR = /home/nagispg/local/pgsql/share
SYSCONFDIR = /home/nagispg/local/pgsql/etc
PGXS = /home/nagispg/local/pgsql/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--prefix=/home/nagispg/local/pgsql'
CC = gcc
CPPFLAGS = -DFRONTEND -D_GNU_SOURCE
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard
-O2
CFLAGS_SL = -fpic
LDFLAGS = -L../../src/common -Wl,--as-needed -Wl,-rpath,'/home/nagispg/
local/pgsql/lib',--enable-new-dtags
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lz -lreadline -lrt -lcrypt -ldl -lm
VERSION = PostgreSQL 9.6.2

From the above, the LIBS doesn't indicate the presence of xml or xslt (i.e
-lxslt -lxml2).

Could someone point me to what I am doing wrong.

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Osahon Oduware (#1)
Re: Build PostgreSQL With XML Support on Linux

On 05/31/2017 06:24 AM, Osahon Oduware wrote:

Hi All,

I successfully built PostgreSQL from source on Linux (Centos 7) using
the following:

What version of Postgres?

./configure --prefix=/home/nagispg/local/pgsql --with-libxml --with-libxslt

I would look in config.log in the build directory for clues.

Prior to this I had installed the xml and xslt packages (amongst others)
using:
yum install libxml2-devel
yum install libxslt-devel

However, when I try to store XML data in a table I get an error. The log
file states that I need to rebuild PostgreSQL with --with-libxml.

When I run pg_config I get the following output:
BINDIR = /home/nagispg/local/pgsql/bin
DOCDIR = /home/nagispg/local/pgsql/share/doc
HTMLDIR = /home/nagispg/local/pgsql/share/doc
INCLUDEDIR = /home/nagispg/local/pgsql/include
PKGINCLUDEDIR = /home/nagispg/local/pgsql/include
INCLUDEDIR-SERVER = /home/nagispg/local/pgsql/include/server
LIBDIR = /home/nagispg/local/pgsql/lib
PKGLIBDIR = /home/nagispg/local/pgsql/lib
LOCALEDIR = /home/nagispg/local/pgsql/share/locale
MANDIR = /home/nagispg/local/pgsql/share/man
SHAREDIR = /home/nagispg/local/pgsql/share
SYSCONFDIR = /home/nagispg/local/pgsql/etc
PGXS = /home/nagispg/local/pgsql/lib/pgxs/src/makefiles/pgxs.mk
<http://pgxs.mk&gt;
CONFIGURE = '--prefix=/home/nagispg/local/pgsql'
CC = gcc
CPPFLAGS = -DFRONTEND -D_GNU_SOURCE
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-fexcess-precision=standard -O2
CFLAGS_SL = -fpic
LDFLAGS = -L../../src/common -Wl,--as-needed
-Wl,-rpath,'/home/nagispg/local/pgsql/lib',--enable-new-dtags
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lz -lreadline -lrt -lcrypt -ldl -lm
VERSION = PostgreSQL 9.6.2

From the above, the LIBS doesn't indicate the presence of xml or xslt
(i.e -lxslt -lxml2).

Could someone point me to what I am doing wrong.

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Adrian Klaver (#2)
Re: Build PostgreSQL With XML Support on Linux

Adrian Klaver <adrian.klaver@aklaver.com> writes:

On 05/31/2017 06:24 AM, Osahon Oduware wrote:

I successfully built PostgreSQL from source on Linux (Centos 7) using
the following:
./configure --prefix=/home/nagispg/local/pgsql --with-libxml --with-libxslt
...
When I run pg_config I get the following output:
LIBS = -lpgcommon -lpgport -lz -lreadline -lrt -lcrypt -ldl -lm

Did you remember to do "make install"? Did you make sure that
/home/nagispg/local/pgsql/bin is in your PATH, ahead of wherever
the old installation is? Alternatively, if you're attempting
to overwrite an old installation, did you remember to restart
the server?

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Osahon Oduware
osahon.gis@gmail.com
In reply to: Adrian Klaver (#2)
Re: Build PostgreSQL With XML Support on Linux

I am using PostgreSQL 9.6.2

On Wed, May 31, 2017 at 2:34 PM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

Show quoted text

On 05/31/2017 06:24 AM, Osahon Oduware wrote:

Hi All,

I successfully built PostgreSQL from source on Linux (Centos 7) using the
following:

What version of Postgres?

./configure --prefix=/home/nagispg/local/pgsql --with-libxml

--with-libxslt

I would look in config.log in the build directory for clues.

Prior to this I had installed the xml and xslt packages (amongst others)
using:
yum install libxml2-devel
yum install libxslt-devel

However, when I try to store XML data in a table I get an error. The log
file states that I need to rebuild PostgreSQL with --with-libxml.

When I run pg_config I get the following output:
BINDIR = /home/nagispg/local/pgsql/bin
DOCDIR = /home/nagispg/local/pgsql/share/doc
HTMLDIR = /home/nagispg/local/pgsql/share/doc
INCLUDEDIR = /home/nagispg/local/pgsql/include
PKGINCLUDEDIR = /home/nagispg/local/pgsql/include
INCLUDEDIR-SERVER = /home/nagispg/local/pgsql/include/server
LIBDIR = /home/nagispg/local/pgsql/lib
PKGLIBDIR = /home/nagispg/local/pgsql/lib
LOCALEDIR = /home/nagispg/local/pgsql/share/locale
MANDIR = /home/nagispg/local/pgsql/share/man
SHAREDIR = /home/nagispg/local/pgsql/share
SYSCONFDIR = /home/nagispg/local/pgsql/etc
PGXS = /home/nagispg/local/pgsql/lib/pgxs/src/makefiles/pgxs.mk <
http://pgxs.mk&gt;
CONFIGURE = '--prefix=/home/nagispg/local/pgsql'
CC = gcc
CPPFLAGS = -DFRONTEND -D_GNU_SOURCE
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard
-O2
CFLAGS_SL = -fpic
LDFLAGS = -L../../src/common -Wl,--as-needed
-Wl,-rpath,'/home/nagispg/local/pgsql/lib',--enable-new-dtags
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lz -lreadline -lrt -lcrypt -ldl -lm
VERSION = PostgreSQL 9.6.2

From the above, the LIBS doesn't indicate the presence of xml or xslt
(i.e -lxslt -lxml2).

Could someone point me to what I am doing wrong.

--
Adrian Klaver
adrian.klaver@aklaver.com

#5Osahon Oduware
osahon.gis@gmail.com
In reply to: Tom Lane (#3)
Re: Build PostgreSQL With XML Support on Linux

Hi Tom,

Thanks for the response. Yes, I did all of that.

On Wed, May 31, 2017 at 2:46 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Show quoted text

Adrian Klaver <adrian.klaver@aklaver.com> writes:

On 05/31/2017 06:24 AM, Osahon Oduware wrote:

I successfully built PostgreSQL from source on Linux (Centos 7) using
the following:
./configure --prefix=/home/nagispg/local/pgsql --with-libxml

--with-libxslt

...
When I run pg_config I get the following output:
LIBS = -lpgcommon -lpgport -lz -lreadline -lrt -lcrypt -ldl -lm

Did you remember to do "make install"? Did you make sure that
/home/nagispg/local/pgsql/bin is in your PATH, ahead of wherever
the old installation is? Alternatively, if you're attempting
to overwrite an old installation, did you remember to restart
the server?

regards, tom lane

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Osahon Oduware (#5)
Re: Build PostgreSQL With XML Support on Linux

Osahon Oduware <osahon.gis@gmail.com> writes:

Thanks for the response. Yes, I did all of that.

Well, better start double-checking, because it certainly appears that
the version of pg_config you're calling is not from a --with-libxml
build.

After thinking a bit, another possible way of messing this up would be
if you were working in a previously-used build tree, and simply did
a new configure run and then "make" without cleaning up the old build
products. You might be able to get away with that if you'd used
--enable-depend, but without it you really need at least "make clean"
and preferably "make distclean" before reconfiguring.

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#7Osahon Oduware
osahon.gis@gmail.com
In reply to: Tom Lane (#6)
Re: Build PostgreSQL With XML Support on Linux

Hi Tom,

Thanks a lot for your response. You made my day! Your thought in the 2nd
paragraph of your response (the "make distclean" stuff) was the solution.
It was an oversight on my part. Thanks once again.

On Wed, May 31, 2017 at 4:49 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Show quoted text

Osahon Oduware <osahon.gis@gmail.com> writes:

Thanks for the response. Yes, I did all of that.

Well, better start double-checking, because it certainly appears that
the version of pg_config you're calling is not from a --with-libxml
build.

After thinking a bit, another possible way of messing this up would be
if you were working in a previously-used build tree, and simply did
a new configure run and then "make" without cleaning up the old build
products. You might be able to get away with that if you'd used
--enable-depend, but without it you really need at least "make clean"
and preferably "make distclean" before reconfiguring.

regards, tom lane