DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Previous Next Contents

35. FAQ - Extending PostgreSQL

35.1 I wrote a user-defined function and when I run it in psql, it dumpscore.

The problem could be a number of things. Try testing your user-defined function in a stand alone test program first. Also, make sure you are not sending elog NOTICES when the front-end is expecting data, such as during a type_in() or type_out() functions

35.2 I get messages of the type NOTICE-PortalHeapMemoryFree- 0x402251d0 not in alloc set!

You are pfree'ing something that was not palloc'ed. When writing user-defined functions, do not include the file "libpq-fe.h". Doing so will cause your palloc to be a malloc instead of a free. Then, when the backend pfrees the storage, you get the notice message.

35.3 I've written some nifty new types and functions for PostgreSQL.

Please share them with other PostgreSQL users. Send your extensions to mailing list, and they will eventually end up in the contrib/ subdirectory.

35.4 How do I write a C function to return a tuple?

This requires extreme wizardry, so extreme that the authors have not ever tried it, though in principle it can be done. The short answer is ... you can't. This capability is forthcoming in the future.

---------------------------------------------------------------------------


Previous Next Contents