Re: libpq/c function question

From: "Joe Conway" <joe(dot)conway(at)mail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: libpq/c function question
Date: 2001-01-28 04:08:31
Message-ID: 01ef01c088df$fa17eb50$0705a8c0@jecw2k1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

> "Joe Conway" <joe(dot)conway(at)mail(dot)com> writes:
> > optstr = PG_GETARG_TEXT_P(0);
> > jpgsql = PG_GETARG_TEXT_P(1);
>
> > conn = PQconnectdb(VARDATA(optstr));
>
> I think you've missed the fact that a TEXT value's VARDATA is not
> null-terminated. There are numerous examples of transforming a TEXT
> into a C string in the backend, see for example text_cmp/varstr_cmp
> in src/backend/utils/adt/varlena.c.
>
> regards, tom lane

That did the trick!

Thank you!!

Joe

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Jean-Francois Burdet 2001-01-29 11:11:14 jdbc: v7.1 bug (letter accent)
Previous Message Tom Lane 2001-01-28 03:48:34 Re: libpq/c function question