pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: darcy@druid.net
Cc: pgsql-sql@postgresql.org
Subject: Re: Using substr with user defined types
Date: Fri, 23 Jun 2000 11:52:25 -0400
Message-ID: <18662.961775545@sss.pgh.pa.us> (raw)
In-Reply-To: <m135Rdt-000AY3C@druid.net>
References: <m135Rdt-000AY3C@druid.net>

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



view thread (10+ messages)  latest in thread

Message-ID: <18662.961775545@sss.pgh.pa.us>
Permalink:  ../18662.961775545@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18662.961775545@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, darcy@druid.net
  Subject: Re: Using substr with user defined types
  In-Reply-To: <18662.961775545@sss.pgh.pa.us>
  References: <m135Rdt-000AY3C@druid.net> <18662.961775545@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox