Re: Getting Text data as C string

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: Denis Gasparin <denis(at)edistar(dot)com>
Subject: Re: Getting Text data as C string
Date: 2007-03-12 12:58:19
Message-ID: 200703121358.20418.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Am Montag, 12. März 2007 12:47 schrieb Denis Gasparin:
> I wrote a simple c stored procedure that accepts only one text parameter
> that i want to convert to a c string.
> The problem is that i obtain the C string correctly but with spurious
> characters at the end... I use these calls to obtain the c string:

The data in a text datum is not null terminated. You need to call the
function textout() to convert. Grep the source code for examples of invoking
it.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joost Kraaijeveld 2007-03-12 13:20:44 PostgreSQL crashes on Windows 2003
Previous Message Douglas McNaught 2007-03-12 12:38:52 Re: DBD::Pg/perl question, kind of...