Re: user defined type

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Kjetil Haaland <kjetil(dot)haaland(at)student(dot)uib(dot)no>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: user defined type
Date: 2004-11-10 18:30:05
Message-ID: 20041110183005.GA17876@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Sean Davis 2004-11-11 12:39:40 ER Diagrams
Previous Message Kjetil Haaland 2004-11-10 13:37:49 Re: user defined type