Re: Postgesql lib

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Lukas" <lukas(at)fmf(dot)vtu(dot)lt>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Postgesql lib
Date: 2009-01-09 13:15:38
Message-ID: 8968.1231506938@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"Lukas" <lukas(at)fmf(dot)vtu(dot)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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message info 2009-01-10 14:47:58 Re: How to release a transaction lock on a table
Previous Message Lukas 2009-01-09 09:08:12 Postgesql lib