"D. Stimits" <stimits@comcast.net> 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