Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.10.1/8.10.1) with ESMTP id e5NFqb119949 for ; Fri, 23 Jun 2000 11:52:37 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id LAA18665; Fri, 23 Jun 2000 11:52:25 -0400 (EDT) To: darcy@druid.net (D'Arcy J.M. Cain) cc: pgsql-sql@postgresql.org Subject: Re: Using substr with user defined types In-reply-to: References: Comments: In-reply-to darcy@druid.net (D'Arcy J.M. Cain) message dated "Fri, 23 Jun 2000 07:29:01 -0400" Date: Fri, 23 Jun 2000 11:52:25 -0400 Message-ID: <18662.961775545@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200006/210 darcy@druid.net (D'Arcy J.M. Cain) writes: >> Not with that much info. Sooner or later you're going to have to >> show us your C code... > char * > chkpass_rout(chkpass *password) > { > char *result; > if (password == NULL) > return (NULL); > if ((result = (char *) palloc(16)) != NULL) > strcpy(result, password->password); > return (result); > } That doesn't return "text", so you can't tell the system it does. Type text is a varlena type, ie, length word followed by data. regards, tom lane