From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Vincas Dargis <vindrg(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: |
Date: | 2012-04-04 15:31:33 |
Message-ID: | 26707.1333553493@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Vincas Dargis <vindrg(at)gmail(dot)com> 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
From | Date | Subject | |
---|---|---|---|
Next Message | leaf_yxj | 2012-04-04 15:39:30 | Questions of the privileges to use the pg_cancel_backend and pg_terminate_backend function. Thanks. |
Previous Message | Eric.Kamradt | 2012-04-04 15:27:46 | Can postgres be configure for GSS/Kerberos authentication without a keyfile? |