Querying $libdir

From: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Querying $libdir
Date: 2003-09-02 23:54:28
Message-ID: Pine.LNX.4.21.0309030036131.32652-100000@ponder.fairway2k.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kuldeep Tanna 2003-09-03 00:13:52 Crosstab function Problem
Previous Message Aaron 2003-09-02 23:53:15 Re: web hosting postgres