pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Scott Muir <wsmuir@islandnet.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: SPI - couple things (7.0.2)
Date: Fri, 23 Feb 2001 17:12:34 -0500
Message-ID: <850.982966354@sss.pgh.pa.us> (raw)
In-Reply-To: <NCBBKLMCJOGCLFHOFECNAEAGDLAA.wsmuir@islandnet.com>
References: <NCBBKLMCJOGCLFHOFECNAEAGDLAA.wsmuir@islandnet.com>

"Scott Muir" <wsmuir@islandnet.com> writes:
> Last night, I attempted to access the data of several TEXT parameters into a
> 'language 'C'' function I've created and got an interesting result...  on of
> the strings gets a little garbled on the end...  I haven't attempted to
> debug it yet (isoloate the behaviour; gave up; went home) but I"m wondering
> if it can be assumed that the (char *) part of the TEXT struct (VARDATA) has
> been terminated at the length specified by the (VARLEN())?? part.

TEXT data is guaranteed *not* to be null terminated.  If you are
writing code that expects it to be, you will have lots of problems.

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <850.982966354@sss.pgh.pa.us>
Permalink:  ../850.982966354@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/850.982966354@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, wsmuir@islandnet.com
  Subject: Re: SPI - couple things (7.0.2)
  In-Reply-To: <850.982966354@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox