Return-Path: owner-postman
Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with SMTP id JAA05200 for postgres-redist; Thu, 5 Jan 1995 09:12:25 -0800
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199501051712.JAA05200@nobozo.CS.Berkeley.EDU>
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from faerie.CS.Berkeley.EDU (faerie.CS.Berkeley.EDU [128.32.37.53]) by nobozo.CS.Berkeley.EDU (8.6.9/8.6.3) with ESMTP id JAA05190 for <postgres@postgres.Berkeley.EDU>; Thu, 5 Jan 1995 09:12:25 -0800
Received: from localhost.Berkeley.EDU (localhost.Berkeley.EDU [127.0.0.1]) by faerie.CS.Berkeley.EDU (8.6.9/8.1B) with SMTP id JAA18330; Thu, 5 Jan 1995 09:12:22 -0800
Message-Id: <199501051712.JAA18330@faerie.CS.Berkeley.EDU>
X-Authentication-Warning: faerie.CS.Berkeley.EDU: Host localhost.Berkeley.EDU didn't use HELO protocol
From: aoki@cs.berkeley.edu (Paul M. Aoki)
To: Xinguo Wei <wei@u.washington.edu>
Cc: postgres <postgres@postgres.Berkeley.EDU>
Subject: Re: Can't use GetAttributeByName for text type.. 
Reply-To: aoki@cs.berkeley.edu (Paul M. Aoki)
In-reply-to: Your message of Thu, 5 Jan 1995 00:54:33 -0800 (PST) 
	     <Pine.A32.3.91c.950105004448.82192A-100000@homer14.u.washington.edu> 
Date: Thu, 05 Jan 95 09:12:17 -0800
X-Sender: aoki@postgres.Berkeley.EDU
Resent-To: postgres-redist@postgres.Berkeley.EDU
X-Mts: smtp
Resent-Date: Thu, 05 Jan 95 09:12:25 -0800
Resent-XMts: smtp

Xinguo Wei <wei@u.washington.edu> writes:
> char name[4];
> strcpy(name,GetAttributeByName(t,"graphic_model", &isnull));

"text" is not a C string.  "text" is

struct varlena {
        int32   vl_len;
        char    vl_dat[1];
};

[...]

typedef struct varlena text;

the data is not NUL-delimited.

(this is not particularly safe code in any case -- what happens if
graphic_model is null?)
--
  Paul M. Aoki          |  University of California at Berkeley
  aoki@CS.Berkeley.EDU  |  Dept. of EECS, Computer Science Division (#1776) 
                        |  Berkeley, CA 94720-1776

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "postgres-request@postgres.Berkeley.EDU".
   If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================
              URL: http://s2k-ftp.CS.Berkeley.EDU:8000/postgres/
