Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Dynamic loading of C functions


  • From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
  • To: "Jasbinder Bali" <jsbali(at)gmail(dot)com>
  • Cc: "Bill Moran" <wmoran(at)collaborativefusion(dot)com>, pgsql-general(at)postgresql(dot)org
  • Subject: Re: Dynamic loading of C functions
  • Date: Tue, 20 Jun 2006 17:24:15 -0400
  • Message-id: <911(dot)1150838655(at)sss(dot)pgh(dot)pa(dot)us>

"Jasbinder Bali" <jsbali(at)gmail(dot)com> writes:
>>> /usr/include/pgsql/server/ is exactly the path where test_func object
>>> file resides.

Hmmm .... when you say "object file", do you mean it's really named
"test_func.o"?

If so, that's both the wrong name and the wrong type of file.  Postgres
is looking for a shared library, eg "test_func.so" (or on some platforms
".sl" or ".dylib").  There's some advice in our manual about the
compiler switches to use to create a shared library, or see your
compiler documentation.

Given AS '/usr/include/pgsql/server/test_func', Postgres will look for
both "test_func" and "test_func.so" (not sure which order, try the LOAD
reference page for details).  It won't look for "test_func.o" though.

BTW, most people would say that /usr/include is exactly where NOT to
put an executable file ... conventionally this kind of file goes under
/usr/lib.  That's not what's causing your problem, it's just a question
of keeping your filesystem tidy enough to be able to find things again.

			regards, tom lane



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group