can't find admin81.sql for postgresql-8.1 server instrumentation functions

Issues related to software problems.
Post Reply
_lalo
Posts: 7
Joined: 2008/01/31 20:12:40
Location: Mexico

can't find admin81.sql for postgresql-8.1 server instrumenta

Post by _lalo » 2008/07/19 20:55:37

Hi i installed postgresql-8.1.11-1.el5_1.1 and PgAdmin3 using Yum, when I connect to my database using PgAdmin3 it throws this message:

The server lacks instrumentation functions.

pgAdmin III uses some support functions that are not available by default in all PostgreSQL versions.
These enable some tasks that make life easier when The server lacks instrumentation functions.

After the module is installed, you need to create the instrumentation functions in your maintenance database using the admin.sql script (admin81.sql for PostgreSQL 8.1) which are usually located in the pgsql share directory (e.g. /usr/local/pgsql/share)

--------------------------------------------
i run as root:
[b]find / -name admin81.sql[/b]

an no results are thrown.

OK so the CentOS team didn't compile PostgreSQL with the admin module, so I need to doit by hand.

I install the sources (postgresql-contrib-8.1.11-1.el5_1.1)with yum:
[b]yum install postgresql-contrib[/b]

then i tried to find something about the admin81 in the postgresqql-contrib, i execute:

[b]rpm -qil postgresql-contrib[/b]


Name : postgresql-contrib Relocations: (not relocatable)
Version : 8.1.11 Vendor: CentOS
Release : 1.el5_1.1 Build Date: Sat 12 Jan 2008 07:45:09 AM MST
Install Date: Sat 19 Jul 2008 01:03:04 PM MDT Build Host: builder6
Group : Applications/Databases Source RPM: postgresql-8.1.11-1.el5_1.1.src.rpm
Size : 1159682 License: BSD
Signature : DSA/SHA1, Sat 12 Jan 2008 08:50:36 PM MST, Key ID a8a447dce8562897
URL : http://www.postgresql.org/
Summary : Contributed source and binaries distributed with PostgreSQL
Description :
The postgresql-contrib package contains contributed packages that are
included in the PostgreSQL distribution.
/usr/bin/DBMirror.pl
/usr/bin/clean_pending.pl
/usr/bin/dbf2pg
/usr/bin/fti.pl
/usr/bin/oid2name
/usr/bin/pgbench
/usr/bin/vacuumlo
/usr/lib/pgsql/_int.so
/usr/lib/pgsql/autoinc.so
/usr/lib/pgsql/btree_gist.so
/usr/lib/pgsql/chkpass.so
/usr/lib/pgsql/cube.so
/usr/lib/pgsql/dblink.so
/usr/lib/pgsql/earthdistance.so
/usr/lib/pgsql/fti.so
/usr/lib/pgsql/fuzzystrmatch.so
/usr/lib/pgsql/insert_username.so
/usr/lib/pgsql/int_aggregate.so
/usr/lib/pgsql/isbn_issn.so
/usr/lib/pgsql/lo.so
/usr/lib/pgsql/ltree.so
/usr/lib/pgsql/moddatetime.so
/usr/lib/pgsql/pending.so
/usr/lib/pgsql/pg_buffercache.so
/usr/lib/pgsql/pg_trgm.so
/usr/lib/pgsql/pgcrypto.so
/usr/lib/pgsql/pgstattuple.so
/usr/lib/pgsql/pgxml.so
/usr/lib/pgsql/refint.so
/usr/lib/pgsql/seg.so
/usr/lib/pgsql/tablefunc.so
/usr/lib/pgsql/timetravel.so
/usr/lib/pgsql/tsearch2.so
/usr/lib/pgsql/user_locks.so
/usr/share/doc/postgresql-contrib-8.1.11
/usr/share/doc/postgresql-contrib-8.1.11/README.adddepend
/usr/share/doc/postgresql-contrib-8.1.11/README.apachelog
/usr/share/doc/postgresql-contrib-8.1.11/README.btree_gist
/usr/share/doc/postgresql-contrib-8.1.11/README.chkpass
/usr/share/doc/postgresql-contrib-8.1.11/README.cube
/usr/share/doc/postgresql-contrib-8.1.11/README.dbf2pg
/usr/share/doc/postgresql-contrib-8.1.11/README.dblink
/usr/share/doc/postgresql-contrib-8.1.11/README.dbmirror
/usr/share/doc/postgresql-contrib-8.1.11/README.earthdistance
/usr/share/doc/postgresql-contrib-8.1.11/README.fti
/usr/share/doc/postgresql-contrib-8.1.11/README.fuzzystrmatch
/usr/share/doc/postgresql-contrib-8.1.11/README.int_aggregate
/usr/share/doc/postgresql-contrib-8.1.11/README.intarray
/usr/share/doc/postgresql-contrib-8.1.11/README.isbn_issn
/usr/share/doc/postgresql-contrib-8.1.11/README.lo
/usr/share/doc/postgresql-contrib-8.1.11/README.ltree
/usr/share/doc/postgresql-contrib-8.1.11/README.mac
/usr/share/doc/postgresql-contrib-8.1.11/README.mpgsql
/usr/share/doc/postgresql-contrib-8.1.11/README.oid2name
/usr/share/doc/postgresql-contrib-8.1.11/README.ora2pg
/usr/share/doc/postgresql-contrib-8.1.11/README.pg_buffercache
/usr/share/doc/postgresql-contrib-8.1.11/README.pg_trgm
/usr/share/doc/postgresql-contrib-8.1.11/README.pgbench
/usr/share/doc/postgresql-contrib-8.1.11/README.pgbench_jis
/usr/share/doc/postgresql-contrib-8.1.11/README.pgcrypto
/usr/share/doc/postgresql-contrib-8.1.11/README.pgstattuple
/usr/share/doc/postgresql-contrib-8.1.11/README.pgstattuple.euc_jp
/usr/share/doc/postgresql-contrib-8.1.11/README.seg
/usr/share/doc/postgresql-contrib-8.1.11/README.soundex
/usr/share/doc/postgresql-contrib-8.1.11/README.spi
/usr/share/doc/postgresql-contrib-8.1.11/README.tablefunc
/usr/share/doc/postgresql-contrib-8.1.11/README.timetravel
/usr/share/doc/postgresql-contrib-8.1.11/README.tsearch2
/usr/share/doc/postgresql-contrib-8.1.11/README.user_locks
/usr/share/doc/postgresql-contrib-8.1.11/README.vacuumlo
/usr/share/doc/postgresql-contrib-8.1.11/README.xml2
/usr/share/doc/postgresql-contrib-8.1.11/autoinc.example
/usr/share/doc/postgresql-contrib-8.1.11/insert_username.example
/usr/share/doc/postgresql-contrib-8.1.11/moddatetime.example
/usr/share/doc/postgresql-contrib-8.1.11/refint.example
/usr/share/doc/postgresql-contrib-8.1.11/timetravel.example
/usr/share/pgsql/contrib
/usr/share/pgsql/contrib/AddTrigger.sql
/usr/share/pgsql/contrib/MirrorSetup.sql
/usr/share/pgsql/contrib/_int.sql
/usr/share/pgsql/contrib/autoinc.sql
/usr/share/pgsql/contrib/btree_gist.sql
/usr/share/pgsql/contrib/chkpass.sql
/usr/share/pgsql/contrib/cube.sql
/usr/share/pgsql/contrib/dblink.sql
/usr/share/pgsql/contrib/earthdistance.sql
/usr/share/pgsql/contrib/english.stop
/usr/share/pgsql/contrib/fti.sql
/usr/share/pgsql/contrib/fuzzystrmatch.sql
/usr/share/pgsql/contrib/insert_username.sql
/usr/share/pgsql/contrib/int_aggregate.sql
/usr/share/pgsql/contrib/isbn_issn.sql
/usr/share/pgsql/contrib/lo.sql
/usr/share/pgsql/contrib/lo_drop.sql
/usr/share/pgsql/contrib/lo_test.sql
/usr/share/pgsql/contrib/ltree.sql
/usr/share/pgsql/contrib/moddatetime.sql
/usr/share/pgsql/contrib/pg_buffercache.sql
/usr/share/pgsql/contrib/pg_trgm.sql
/usr/share/pgsql/contrib/pgcrypto.sql
/usr/share/pgsql/contrib/pgstattuple.sql
/usr/share/pgsql/contrib/pgxml.sql
/usr/share/pgsql/contrib/refint.sql
/usr/share/pgsql/contrib/russian.stop
/usr/share/pgsql/contrib/seg.sql
/usr/share/pgsql/contrib/slaveDatabase.conf
/usr/share/pgsql/contrib/tablefunc.sql
/usr/share/pgsql/contrib/timetravel.sql
/usr/share/pgsql/contrib/tsearch2.sql
/usr/share/pgsql/contrib/untsearch2.sql
/usr/share/pgsql/contrib/user_locks.sql


But i still can't find the [b]admin81.sql[/b] script, and also I don't know what module is the admin module that I need to load if there is one....

ps.
Instrumentation really seemed like a core thing that one would want in a database.

_lalo
Posts: 7
Joined: 2008/01/31 20:12:40
Location: Mexico

Re: can't find admin81.sql for postgresql-8.1 server instrumentation functions

Post by _lalo » 2008/07/20 03:21:46

To succesfully install the server instrumentation functions I download this package:
[b]admin81-1.4.3.tar.gz[/b]
from here:
http://www.postgresql.org/ftp/pgadmin3/release/v1.4.3/adminpacks/

But also need the postgresql-devel, that match postgresql-8.1.11-1.el5_1.1 to re-compile it from source

so i execute:
[b]yum install postgresql-devel[/b]

Ok I'm going to tray to install everything, and I'm going to post my results.

_lalo
Posts: 7
Joined: 2008/01/31 20:12:40
Location: Mexico

Re: can't find admin81.sql for postgresql-8.1 server instrumentation functions

Post by _lalo » 2008/07/20 20:12:27

After I downloaded the admin81-1.4.3.tar.gz, I extracted the content. (tar -xzvf admin81-1.4.3.tar.gz). Then placed it into a directory called "contrib" wish is supposedly located in the source tree of postgresql, but it isn't so i created it:

[b]$ cd /usr/lib/pgsql/pgxs/src/[/b]
[b]$ mkdir contrib[/b]

Then now i moved the recently extracted admin81 into the contrib directory

[b]$ move /home/you'reUser/admin81 /usr/lib/pgsql/pgxs/src/contrib/[/b]

ok now we take a look at the files of admin81

[b]$ cd /usr/lib/pgsql/pgxs/src/contrib/admin81[/b]
[b]$ ls [/b]
[i]admin81.c admin81.sql.in Makefile README.admin81[/i]

then we take a clooser look to the content of the Makefile:

[b]$ cat Makefile [/b][i]
subdir = contrib/admin81
top_builddir = ../..
include $(top_builddir)/src/Makefile.global

MODULE_big = admin81
PG_CPPFLAGS = -I$(libpq_srcdir)
DATA_built = admin81.sql
DOCS = README.admin81
OBJS = admin81.o

include $(top_srcdir)/contrib/contrib-global.mk[/i]

So as you see we have 2 includes in the make file, or dependencies as I see it, the Makefile.global and the contrib-global.mk
The first one (Makefile.global) is located at:
[i]/usr/lib/pgsql/pgxs/src/Makefile.global[/i]
And the second is not present, because it was supposedly to be inside the "contrib" directory which I create by hand.

So until I find it I'm not going to be able to compile the Makefile. look

[b]$ make all[/b][i]
Makefile:3: ../../src/Makefile.global: No such file or directory
Makefile:11: /contrib/contrib-global.mk: No such file or directory
make: *** No rule to make target `/contrib/contrib-global.mk'. Stop.[/i]

..ups 2 errors, easily I resolve the first one, just edit the Makefile and add ".." at the end of the top_builddir, to look like this:

[b]$ cat Makefile [/b][i]
subdir = contrib/admin81
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global

MODULE_big = admin81
PG_CPPFLAGS = -I$(libpq_srcdir)
DATA_built = admin81.sql
DOCS = README.admin81
OBJS = admin81.o

include $(top_srcdir)/contrib/contrib-global.mk[/i]

then again we execute make all:
[b]$ make all [/b][i]
Makefile:11: ../../../contrib/contrib-global.mk: No such file or directory
make: *** No rule to make target `../../../contrib/contrib-global.mk'. Stop.[/i]

Ready just as I said before there's one file missing the contrib-global.mk, I'm going to look around to see how can I get it.
See you later.

_lalo
Posts: 7
Joined: 2008/01/31 20:12:40
Location: Mexico

Re: can't find admin81.sql for postgresql-8.1 server instrumentation functions

Post by _lalo » 2008/07/20 20:47:22

Jesus Christ!!! I was looking in the wrong place:
here is the simple solution:
http://www.postgresql.org/docs/current/static/contrib.html

just what i need was the postgresql-contrib package and then run the sql scripts in the database that i want to have the additional functions

_lalo
Posts: 7
Joined: 2008/01/31 20:12:40
Location: Mexico

Re: can't find admin81.sql for postgresql-8.1 server instrumentation functions

Post by _lalo » 2008/07/20 21:06:42

Well it's true but just applies to the version 8.3
In the middle time we are going to have to wait for a PostgreSQL update by RedHat o the ContOs Team

Post Reply