Re: Using substr with user defined types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: darcy(at)druid(dot)net (D'Arcy J(dot)M(dot) Cain)
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Using substr with user defined types
Date: 2000-06-23 15:52:25
Message-ID: 18662.961775545@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

darcy(at)druid(dot)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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2000-06-23 15:59:03 Re: Orderby two different columns
Previous Message Jeff Hoffmann 2000-06-23 15:42:26 Re: Merging two columns into one