--S5HS5MvDw4DmbRmb
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Tue, May 06, 2008 at 09:39:50AM -0600, Dan Heron Myers wrote:
> Using DatumToCString(mytextvariable), I get single-character-length=20
> strings that do not match the data actually in the fields.
Correct, because it's not a cstring. Pretending it is one gives you
garbage.
> Using VARDATA(mytextvariable) as the char*, I get things like this
(name=
=20
> obscured) (using strlen to get the string's length):
Not null terminated.
> Which is what I need. Perhaps we could get some do***entation about
how=
=20
> to use this stuff? I was unable to find any on the Postgres site, if=20
> there is any.
Well, here's an example of how you should do it:
http://www.postgresql.org/docs/8.2/interactive/spi-examples.html
Not the most obvious place. The best place is the source,
utils/adt/text contains lots of functions on text variables, so you can
see how they work.
Have a nice day,
--=20
Martijn van Oosterhout <kleptog@[EMAIL PROTECTED]
> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while=20
> boarding. Thank you for flying nlogn airlines.
--S5HS5MvDw4DmbRmb
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFIIIBwIB7bNG8LQkwRApBRAJ4ylBQVcb6priTuEiFwg9R10DwjmQCePyBu
N3b40eh9c0UfoMR1C1aQF5g=
=w0ew
-----END PGP SIGNATURE-----
--S5HS5MvDw4DmbRmb--


|