Re: [HACKERS] Testing for a shared library

2005-09-07 Thread Tom Lane
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes:
> Is there any way of checking to see if a particular shared library is 
> installed?

Try to LOAD it, perhaps.

regards, tom lane

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] Testing for a shared library

2005-09-07 Thread Christopher Kings-Lynne
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:
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





---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [HACKERS] Testing for a shared library

2005-09-07 Thread Teodor Sigaev

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: [EMAIL PROTECTED]
   WWW: http://www.sigaev.ru/

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] Testing for a shared library

2005-09-07 Thread Dave Page
 

> -Original Message-
> From: Christopher Kings-Lynne [mailto:[EMAIL PROTECTED] 
> 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

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] Testing for a shared library

2005-09-07 Thread Dave Page
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] 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.

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] Testing for a shared library

2005-09-07 Thread Christopher Kings-Lynne
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

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly