Received: from zukerman-1.dsl.speakeasy.net (zukerman-1.dsl.speakeasy.net [216.254.75.142]) by hub.hub.org (8.10.1/8.10.1) with ESMTP id e9FE0Bq34353 for ; Sun, 15 Oct 2000 10:00:11 -0400 (EDT) Received: from (matt.w80.math-hat.com) [216.254.75.141] by zukerman-1.dsl.speakeasy.net with esmtp (Exim 3.12 #1 (Debian)) id 13koEc-0002yT-00; Sun, 15 Oct 2000 09:53:54 -0400 Received: from zukerman by matt.w80.math-hat.com with local (Exim 3.16 #1 (Debian)) id 13koKg-0006ky-00 for ; Sun, 15 Oct 2000 10:00:10 -0400 To: pgsql-sql@postgresql.org Subject: Variable-length Types From: Itai Zukerman Date: 15 Oct 2000 10:00:10 -0400 Message-ID: <871yxi432t.fsf@matt.w80.math-hat.com> Lines: 25 User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200010/130 X-Sequence-Number: 1792 I'm going from the documentation in the Programmer's Guide, chapter 4. I'd like to have the following type available in Postegres: typedef struct FullName { char *first; char *last; } FullName; According to the docs, it looks like I need to do something like: typedef struct FullName { int4 len; int first; int last; char data[1]; } FullName; where data[] stores both first and last names (has two '\0' terminators in it), and first and last are indexes into data[]? Is there a better way to do this? -itai