473,387 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Can't initdb, libdir points to static location

I use PostgreSQL as a default database in our solution and with the
7.2 version I was able to tar up the area pointed to by the --prefix
build argument and untar to an arbitrary path as part of my product
installation and I could initdb the database no problem and get a
running database setup completely.

With the 7.4 released version I get this failure while running initdb:

ERROR: could not access file "$libdir/ascii_and_mic": No such file or
directory

This is due to the fact that the libdir is pointing to the lib under
the prefix area I specified when I built the postgresql distribution,
but it no longer exists.

I tried modifying initdb to add the -c dynamic_library_path=<mypath>
but that didn't help. It appears that libdir is basically hardcoded to
be PKGLIBDIR from the build, which won't work in this case.

Setting dynamic_library_path=<mypath> in the postgresql.conf would
work I think, except that initdb doesn't use that at creation time.
The datadir has to be empty an initdb time.

Is there an environment variable that can override this like
LD_LIBRARY_PATH ?
I'm looking for any ideas. Thanks.

Tim Farrell
Nov 12 '05 #1
2 3164
Tim Farrell writes:
I use PostgreSQL as a default database in our solution and with the
7.2 version I was able to tar up the area pointed to by the --prefix
build argument and untar to an arbitrary path as part of my product
installation and I could initdb the database no problem and get a
running database setup completely.
OK, but it was never intended that this would work. In fact, it was
specifically documented as not working well. Maybe you want to do 'make
install DESTDIR=...' instead, to create a "fake root" installation that
you can tar up.
Is there an environment variable that can override this like
LD_LIBRARY_PATH ?


There isn't one right now, but the environment variable might not be a bad
idea.

--
Peter Eisentraut pe*****@gmx.net
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 12 '05 #2
pe*****@gmx.net (Peter Eisentraut) wrote in message news:<Pi**************************************@pet er.localdomain>...
Tim Farrell writes:
I use PostgreSQL as a default database in our solution and with the
7.2 version I was able to tar up the area pointed to by the --prefix
build argument and untar to an arbitrary path as part of my product
installation and I could initdb the database no problem and get a
running database setup completely.
OK, but it was never intended that this would work. In fact, it was
specifically documented as not working well. Maybe you want to do 'make
install DESTDIR=...' instead, to create a "fake root" installation that
you can tar up.


Setting DESTDIR doesn't fix the issue because the macro referenced in
the conversion_create.sql script is defined at compile time to take
whatever value
PKGPREFIX resolves to. This means that no matter what path I use to
compile the distribution with, the $libdir will not resolve correctly.
If I tar up the distribution and untar it into an arbitrary directory
the $libdir will not resolve to find the correct shared libraries.
Is there an environment variable that can override this like
LD_LIBRARY_PATH ?


There isn't one right now, but the environment variable might not be a bad
idea.


To work around this I changed dfmgr.c to look for an alternate value
for $libdir if the compile time value of PKGPREFIX doesn't exist in
the environment variable PGDATA. Its a hack but it works for me right
now.

Seems to me that removing the path from the shared libraries
referenced in the conversion_create.sql script and letting them be
found with LD_LIBRARY_PATH and dlopen would be a better way to handle
this. There must be some history as to why the $libdir macro is used
in this case that is preventing a solution like this ?

Thanks for the new 7.4 version of postgres, we were using 7.2.1
previously. Keep up the good work.

Tim
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rich Cullingford | last post by:
Hello, I've been trying to automate the installation of a PG 7.3.3 database on a new machine, starting with a tarball containing the 'binaries' for the system (i.e., everything but PGDATA). (The...
1
by: Nigel J. Andrews | last post by:
The subject says it really. Is there a way to query the value of $libdir, and I don't mean the dynamic_library_path GUC? I ask because, I have scripts to create databases and I've come to make...
1
by: Seamus Thomas Carroll | last post by:
Hi, I have installed postgres in a non-standard location with this call to configure: ../configure --prefix=/scratch/postgresql-7.4/ --exec-prefix=/scratch/postgresql-7.4...
10
by: David Garamond | last post by:
Reading the archives and the FAQ, it seems to be implied that LIKE can use index (and ILIKE can't; so to do case-insensitive search you need to create a functional index on LOWER(field) and say:...
1
by: Medora Schauer | last post by:
I've installed 7.4.2 on a PowerPC system running linux 2.4.13. When I try to run initdb to create to create the database cluster I get the following: $ initdb -D $PGDATA The files...
2
by: tech tech | last post by:
Hello All, I installed postgresql 7.3.4 on HPUX PA in /usr/local/pgsql and put the libraries in /usr/local/pgsql/lib/LIB_new. During the initialization( initdb), it loads libraries (language)...
3
by: Clodoaldo Pinto Neto | last post by:
Hi all, I'm restoring a database from 7.3.4 FC1 to 7.4.2 FC2: $ pg_restore -d KakaoStats KakaoStats.dump pg_restore: could not execute query: ERROR: could not access file...
24
by: Paul | last post by:
I am taking over an existing app and having trouble understanding their references. They have encapsulated Pear packages in the directory structure like: /site /site/html/Pear.php...
5
by: boblatest | last post by:
Hello, it's still me, being unable to load certain modules (for instance, odbc) in scripts that run though IDLE. I've now written a self- containing script that illustrates the whole problem: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.