By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,775 Members | 1,740 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,775 IT Pros & Developers. It's quick & easy.

Querying $libdir

P: n/a


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
adjustments to load tsearch2. Now contrib/tsearch2 installs itself into $libdir
with tsearch2.sql installed as $libdir/contrib/tsearch2.sql. So my scripts
either need to know via hardcoding where tsearch2.sql is installed, try to
work it out from file system searching, ask the user running the scripts or
obtain it from the horses mouth.

Hardcoding where I think it is installed is fine until the build happens on a
system I don't control. Same thing for a list of hardcoded likely locations.

File system searching again uses information about where I think things are
installed or tries to determine it by finding out where applications like psql
are located (assuming the picked up psql is part of the same installation as
the backend it is talking to) and doing some jiggery pokery from there, again
making some installation location assumptions to find a suitably named file.

Asking the user is fine, would work and is a reasonably quick solution. It just
spoils the look of things when scripts run by other scripts start pestering the
user for info about the system things.

Or, I could just ask the horses mouth by issuing a query in the backend via
psql.

Guess which I think I want to use. The question being is this even possible in
a stock 7.3 server?

I know it's not the right list but seeing as I'm emailing. tsearch2 doesn't
even compile outside of contrib/ I presume that is necessary? Is there any
particular reason why the stop word files are installed with no permissions for
'world'? It kinda screws up installing as one user and running as another.
--
Nigel J. Andrews
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 11 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

Replying to myself...

On Wed, 3 Sep 2003, Nigel J. Andrews wrote:

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
adjustments to load tsearch2. Now contrib/tsearch2 installs itself into $libdir
with tsearch2.sql installed as $libdir/contrib/tsearch2.sql...


I got that wrong, it actually installs tsearch2.sql into
$libdir/../share/contrib/ without specifically setting a different location for
shared files.

However, I also note that the functions are installed into public schema. That
looked fine when I first checked that it wasn't polluting namespaces in the
search path. Unfortunately, the database I'm looking at at the moment doesn't
have public in the user's search paths. Therefore, I'm going to have to bring
tsearch2 into my own release procedures, something not made easy by it only
being compilable within the contrib directory of the main source tree.
--
Nigel J. Andrews
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 11 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.