Return-Path: postman 
Delivery-Date: Tue, 31 Aug 93 08:01:25 PDT
Return-Path: postman
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA22034; Tue, 31 Aug 93 07:57:25 -0700
Resent-From: postman (POSTGRES mailing list)
Resent-Message-Id: <9308311457.AA22034@postgres.Berkeley.EDU>
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: M.J.Ridley@comp.brad.ac.uk
Received: from comp.brad.ac.uk by postgres.Berkeley.EDU (5.61/1.29)
	id AA22026; Tue, 31 Aug 93 07:57:15 -0700
Received: from comp.brad.ac.uk by dcsun2.comp.brad.ac.uk with SMTP (PP) 
          id <27051-0@dcsun2.comp.brad.ac.uk>; Tue, 31 Aug 1993 16:07:24 +0100
From: mick <M.J.Ridley@comp.brad.ac.uk>
Date: Tue, 31 Aug 93 16:07:21 BST
Message-Id: <27047.9308311507@dcsun2.comp.brad.ac.uk>
To: avi@postgres.Berkeley.EDU, postgres@postgres.Berkeley.EDU
Subject: Re: text type
Resent-To: postgres-dist
Resent-Date: Tue, 31 Aug 93 07:57:23 PDT

> From: Avi Pfeffer <avi@postgres.Berkeley.EDU>
> To: jaws@pangaea.dme.nt.gov.au, postgres@postgres.Berkeley.EDU
> Subject: Re: text type
> Resent-To: postgres-dist@postgres.Berkeley.EDU
> Resent-Date: Wed, 25 Aug 93 01:05:37 PDT
> Content-Length: 591
> 
> jaws@pangaea.dme.nt.gov.au (James Woods) writes :
> > I have a user defined function written in C which takes an argument of
> > type text.  When the backend passes this argument in, is the string
> > that is passed in NULL terminated?  I have a feeling that it doesn't as
> > my function appears to be producing data with garbage on the and of the
> > strings.
> 
> > If it is not NULL terminated what is the correct way to create a NULL
> > terminated string out of it so that I can use the normal str functions
> > on it?
> 
> Type text is NOT a null-terminated string.  To convert it to one use
> textout.
> 
> avi
> 

Ive been using byteaout rather than textout.
This came from a similar problem to James Woods', I think I just
grepped through the source code to find that text was a varlena
and then found byteaout as a text to char * converter.
Is textout to be be preferred/likely to be more stable over future
releases ? And should it have been obvious where to find the information ?

Mick Ridley                    Dept of Computing
                               Phoenix Bldg
M.J.Ridley@bradford.ac.uk      Univ of Bradford
                               Bradford BD7 1DP
0274 383946                    UK
