Re: user defined type - Mailing list pgsql-novice

From Michael Fuhr
Subject Re: user defined type
Date
Msg-id 20041110183005.GA17876@winnie.fuhr.org
Whole thread Raw
In response to Re: user defined type  (Kjetil Haaland <kjetil.haaland@student.uib.no>)
Responses Re: user defined type
List pgsql-novice
On Wed, Nov 10, 2004 at 02:37:49PM +0100, Kjetil Haaland wrote:

> Is there anyway to have two or more strings in one type or do i have to save
> them both in one string?

PostgreSQL needs all the data in a single buffer.  If you want to
work with multiple variable-length fields, then you could define a
structure that's easy for your code to work with and serialize it
before returning it to PostgreSQL, or one that uses pointers that
point to the correct places in the buffer.  Your alignres_out()
function will need to reverse that effect so it can work with the
data that PostgreSQL passes it.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-novice by date:

Previous
From: Kjetil Haaland
Date:
Subject: Re: user defined type
Next
From: Sean Davis
Date:
Subject: ER Diagrams