Re: more on undefined reference to 'pg_detoast_datum'

From: "D(dot) Stimits" <stimits(at)comcast(dot)net>
To:
Cc: postgresql <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: more on undefined reference to 'pg_detoast_datum'
Date: 2003-10-13 08:39:59
Message-ID: 3F8A64DF.1080008@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-interfaces

Tom Lane wrote:

> "D. Stimits" writes:
>
> >Apparently in PosgreSQL 7.2.3 (the Redhat 7.3 version, which has some
> >patching involved), pg_detoast_datum is defined in fmgr backend code,
> >but this function is not defined anywhere in any library, especially not
> >libpq.
>
>
> Of course not; it's a backend function. Your problem is that you are
> trying to build a server-side function as though it were a client
> application. You're linking to an inappropriate set of libraries.
> See the contrib modules for numerous examples of correct link setup
> for server-side functions.
>
> regards, tom lane
>

My attempt to try linking against some of the client libraries was to
find a link source for CurrentMemoryContext and MemoryContextAlloc. The
headers for backend development include prototypes as extern for many
functions, such as those above. It's painfully obvious that glibc does
not provide these definitions, and it is obvious also that the client
libraries do not implement these. My question is, where the heck is
CurrentMemoryContext and MemoryContextAlloc provided as an
implementation which I can link with? It looks like the Redhat 7.3
(PostgreSQL 7.2.3) devel rpm package is missing the library needed. Or
perhaps there is no such library, and I'd be required to drop my code
into the complete source of the SQL server itself, which is most
inconvenient. How the heck do I find an implentation of
CurrentMemoryContext and MemoryContextAlloc? Running ldd on sample
contrib libraries leads me to believe that in order to build this code,
I must have a built full PostgreSQL source installed and configured, and
that these functions are not available as a linkable library. Which .o
object file would I link? Why isn't CurrentMemoryContext or
MemoryContextAlloc available in a linkable library instead?

D. Stimits

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David McLoughlin 2003-10-13 08:49:10 Re: libreadline.so.4 problems on solaris
Previous Message Alex 2003-10-13 08:19:42 libreadline.so.4 problems on solaris

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2003-10-13 14:42:40 Re: more on undefined reference to 'pg_detoast_datum'
Previous Message Tom Lane 2003-10-12 05:21:22 Re: more on undefined reference to 'pg_detoast_datum' and libpq