Re: Problems using palloc in postgresql user C functions - Mailing list pgsql-novice

From Tom Lane
Subject Re: Problems using palloc in postgresql user C functions
Date
Msg-id 6473.1048083766@sss.pgh.pa.us
Whole thread Raw
In response to Re: Problems using palloc in postgresql user C functions  (John Gunther <inbox@bucksvsbytes.com>)
Responses Re: Problems using palloc in postgresql user C functions  (Joe Conway <mail@joeconway.com>)
List pgsql-novice
John Gunther <inbox@bucksvsbytes.com> writes:
> In line with your responses, I'm already supplying my library with the
> prototypes for all the needed PG functions, like textin. The problem is
> when compiling and linking, how does libtool/gcc find or point to the
> actual code for textin so it can execute it when needed.

It doesn't.  You should be building a shared library, not a standalone
executable.  Unresolved references get bound when the library is loaded
by the backend, not when the library is built.

I'd suggest building one of the backend-extension modules in contrib/,
and looking to see what commands get used to compile and link on your
platform.

            regards, tom lane

pgsql-novice by date:

Previous
From: John Gunther
Date:
Subject: Re: Problems using palloc in postgresql user C functions
Next
From: Joe Conway
Date:
Subject: Re: Problems using palloc in postgresql user C functions