Re: SPI - couple things (7.0.2) - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: SPI - couple things (7.0.2)
Date
Msg-id 850.982966354@sss.pgh.pa.us
Whole thread Raw
In response to SPI - couple things (7.0.2)  ("Scott Muir" <wsmuir@islandnet.com>)
List pgsql-interfaces
"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


pgsql-interfaces by date:

Previous
From: "Scott Muir"
Date:
Subject: SPI - couple things (7.0.2)
Next
From: Thomas Lockhart
Date:
Subject: Re: SPI - couple things (7.0.2)