Return-Path: postarch
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA07118; Sun, 17 May 92 15:55:30 -0700
Message-Id: <9205172255.AA07118@postgres.Berkeley.EDU>
From: postarch (Postgres Mailing Archive)
Subject: Re: Help!! Arrays of tuples not allowed.
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
Reply-To: mer@postgres.berkeley.edu
In-Reply-To: Your message of "Fri, 08 May 92 07:35:31 PDT."
             <9205081435.AA15988@postgres.Berkeley.EDU> 
Date: Sun, 17 May 92 15:55:21 PDT

you write:
> I am trying to use postgres to model information about C++ classes.
> 
> The most natural way to model this information is through a set of nested
> "classes" where a CLASS contains an array of METHOD and BASECLASS instances
> and a METHOD contains an array of ARG instances. The following is an example.
> 
> create BASECLASS(name=text, virtual=bool, access=...)
> 
> create ARG(name=text, type=text, description=text, ...)
> 
> create METHOD(name=text, type=text, args=ARG[], ...)
> 
> create CLASS(name=text, baseclasses=BASE[], methods=METHOD[], ...)
> 
> This model does not work in postgres since arrays of tuples(class instances)
> are not supported. User defined types do not seem to be the solution because
> all of the useful information would be bottled up inside the types.
> 
> Will someone please shed some light on how this kind of information should
> be modelled in postgres?

This may not be the best way, but you can take advantage of postgres oids:

	create BASE (name=text, virtual=bool, access=...)
	create ARG(name=text, type=text, description=text, ...)
	create create METHOD(name=text, type=text, args=oid[], ...)
	create CLASS(name=text, baseclasses=oid[], methods=oid[], ...)

And store the appropriate oids in the arrays.


Jeff Meredith
mer@postgres.berkeley.edu
