Re: Postgesql lib - Mailing list pgsql-novice

From Tom Lane
Subject Re: Postgesql lib
Date
Msg-id 8968.1231506938@sss.pgh.pa.us
Whole thread Raw
In response to Postgesql lib  ("Lukas" <lukas@fmf.vtu.lt>)
Responses Re: Postgesql lib  ("Lukas" <lukas@fmf.vtu.lt>)
List pgsql-novice
"Lukas" <lukas@fmf.vtu.lt> writes:
>  I am trying to write simple PG Lib on C (on Linux), it is working, bus I
> have some problem with data types, maybe someone can explain me a little
> bit:

You're assuming that VARDATA() produces a null-terminated string.
It doesn't.  You either need to call textout to get a null-terminated
string, or fix the fprintf calls to pay attention to the actual
string length.

>     ats = pclose (sendmail);
>     PG_RETURN_TEXT_P( ats );

... and this part is even less likely to work.  pclose returns an
integer.

            regards, tom lane

pgsql-novice by date:

Previous
From: "Lukas"
Date:
Subject: Postgesql lib
Next
From: "info"
Date:
Subject: Re: How to release a transaction lock on a table