Vincas Dargis <vindrg@xxxxxxxxx> writes: > I am experimenting with user defined functions in C, though I have > problem with stability. The only obvious problem in what you posted is > command = "SELECT 1"; > ... > pfree(command); pfree'ing a constant is pretty much guaranteed to crash. I am guessing the reason you don't see "5" printed is that the if() fails, though it's not obvious why. More generally, instead of putting an elog every two lines, I'd suggest expending the effort to learn to use a debugger. Having something that actually traps at the point of a crash is a lot more useful than trying to triangulate on the problem between inserted prints. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general