Subject: Help!! Arrays of tuples not allowed.

From: [email-masked] (lee daniels)
Date: Fri, 8 May 92 07:35:31 -0700

I am new to postgres so please excuse my jargon if it is flawed.

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?

If I am using postgres is not intended to solve this problem, let me know that
also.

thanks in advance,

Lee Daniels
[email-masked]

---

From: postarch (Postgres Mailing Archive)
Date: Sun, 17 May 92 15:55:21 PDT

> Will someone please shed some light on how this kind of information should

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
[email-masked]