Testing for a shared library

Started by Christopher Kings-Lynneover 20 years ago7 messages
#1Christopher Kings-Lynne
chriskl@familyhealth.com.au

Hi,

Is there any way of checking to see if a particular shared library is
installed?

eg. select is_shared_library('$libdir/tsearch2');

If not, can we please have one :D

This will greatly help in GUI apps like phpPgAdmin...

Chris

#2Dave Page
dpage@vale-housing.co.uk
In reply to: Christopher Kings-Lynne (#1)
Re: Testing for a shared library

-----Original Message-----
From: pgsql-hackers-owner@postgresql.org
[mailto:pgsql-hackers-owner@postgresql.org] On Behalf Of
Christopher Kings-Lynne
Sent: 07 September 2005 09:03
To: PostgreSQL-development
Subject: [HACKERS] Testing for a shared library

Hi,

Is there any way of checking to see if a particular shared library is
installed?

eg. select is_shared_library('$libdir/tsearch2');

How well do you know the library you are looking for? You could just try
creating a function from it and seeing if it fails.

Regards, Dave.

#3Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Dave Page (#2)
Re: Testing for a shared library

Is there any way of checking to see if a particular shared library is
installed?

eg. select is_shared_library('$libdir/tsearch2');

How well do you know the library you are looking for? You could just try
creating a function from it and seeing if it fails.

I know it pretty well, but it seems kind of lame to have to create the
function and test for it, especialyl if you have a non-error tolerating
environment.

Plus, you have to know what exported functions it has and you have to
worry about creating any input and return types, etc.

Chris

#4Dave Page
dpage@vale-housing.co.uk
In reply to: Christopher Kings-Lynne (#3)
Re: Testing for a shared library

-----Original Message-----
From: Christopher Kings-Lynne [mailto:chriskl@familyhealth.com.au]
Sent: 07 September 2005 09:16
To: Dave Page
Cc: PostgreSQL-development
Subject: Re: [HACKERS] Testing for a shared library

Is there any way of checking to see if a particular shared

library is

installed?

eg. select is_shared_library('$libdir/tsearch2');

How well do you know the library you are looking for? You

could just try

creating a function from it and seeing if it fails.

I know it pretty well, but it seems kind of lame to have to
create the
function and test for it, especialyl if you have a non-error
tolerating
environment.

Yeah, but if you need a quick hack...

Plus, you have to know what exported functions it has and you have to
worry about creating any input and return types, etc.

That's why I asked how well you know the library :-)

/D

#5Teodor Sigaev
teodor@sigaev.ru
In reply to: Christopher Kings-Lynne (#1)
Re: Testing for a shared library

As you know, presence of shared library doesn't mean precense of module in db :).

You can try selecting:

# select count(*) from pg_opclass where opcname = 'tsvector_ops';

or, more general,

# select count(*) from pg_proc where probin = '$libdir/tsearch2';

But not all modules adds new function...

Christopher Kings-Lynne wrote:

Hi,

Is there any way of checking to see if a particular shared library is
installed?

eg. select is_shared_library('$libdir/tsearch2');

If not, can we please have one :D

This will greatly help in GUI apps like phpPgAdmin...

Chris

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

--
Teodor Sigaev E-mail: teodor@sigaev.ru
WWW: http://www.sigaev.ru/

#6Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Teodor Sigaev (#5)
Re: Testing for a shared library

No, I want to check that the shared library exists (eg. the slony
libraries) BEFORE executing the slony sql script that creates all the
objects.

Chris

Teodor Sigaev wrote:

Show quoted text

As you know, presence of shared library doesn't mean precense of module
in db :).

You can try selecting:

# select count(*) from pg_opclass where opcname = 'tsvector_ops';

or, more general,

# select count(*) from pg_proc where probin = '$libdir/tsearch2';

But not all modules adds new function...

Christopher Kings-Lynne wrote:

Hi,

Is there any way of checking to see if a particular shared library is
installed?

eg. select is_shared_library('$libdir/tsearch2');

If not, can we please have one :D

This will greatly help in GUI apps like phpPgAdmin...

Chris

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Christopher Kings-Lynne (#1)
Re: Testing for a shared library

Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:

Is there any way of checking to see if a particular shared library is
installed?

Try to LOAD it, perhaps.

regards, tom lane