X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 2D8D1D1B529 for ; Mon, 13 Oct 2003 23:14:37 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 55653-03 for ; Mon, 13 Oct 2003 20:14:06 -0300 (ADT) Received: from smtp016.mail.yahoo.com (smtp016.mail.yahoo.com [216.136.174.113]) by svr1.postgresql.org (Postfix) with SMTP id 2CEBBD1B502 for ; Mon, 13 Oct 2003 20:14:05 -0300 (ADT) Received: from pcp01341166pcs.wilog301.pa.comcast.net (HELO europa.janwieck.net) (janwieck@68.80.245.191 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 13 Oct 2003 16:07:28 -0000 Received: from Yahoo.com (ismtp.afilias.com [216.217.55.254]) (authenticated) by europa.janwieck.net (8.11.6/8.11.6) with ESMTP id h9DG7P309920; Mon, 13 Oct 2003 12:07:25 -0400 Message-ID: <3F8ACDA2.7050802@Yahoo.com> Date: Mon, 13 Oct 2003 12:06:58 -0400 From: Jan Wieck User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: stimits@comcast.net Cc: postgresql Subject: Re: more on undefined reference to 'pg_detoast_datum' References: <3F886324.8020707@comcast.net> <558.1065936082@sss.pgh.pa.us> <3F8A64DF.1080008@comcast.net> In-Reply-To: <3F8A64DF.1080008@comcast.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/28 X-Sequence-Number: 4517 D. Stimits wrote: > 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? I am still confused about what you're trying to build. Anyhow, CurrentMemoryContext and MemoryContextAlloc are global symbols of the servers backend memory management system. If you're building a function that you plan to load dynamically into the database server process via CREATE FUNCTION, then you will definitely NOT link against libpq and should follow the plenty examples as suggested by Tom. If you are developing a client application that will connect to a backend via the libpq client library, than you don't have these functions/globals available. We do not provide this memory management system as a standalone, linkable library. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #