Arrays of user-defined data types in other user-defined data types

From: James DeMond <demond(at)cs(dot)dal(dot)ca>
To: pgsql-novice(at)postgresql(dot)org
Subject: Arrays of user-defined data types in other user-defined data types
Date: 2005-01-31 04:12:32
Message-ID: Pine.GSO.4.58.0501310002460.23121@torch.cs.dal.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


Howdy,

I'm having a little bit of trouble making arrays of a data type I'm
defining into another data type I'm defining.

What I'm trying to do is this:

create type MYSCHEMA.T_QUESTION_RESULT as (
IND_QUESTION NUMERIC,
N_ANSWER NUMERIC
);

create type MYSCHEMA.T_QUESTION_RESULT_LIST as (
col1 MYSCHMA.T_QUESTION_RESULT[]
);

Truth be told, I'm actually trying to port this from some definitions I
have from Oracle which look like this:

create or replace type MYSCHEMA.T_QUESTION_RESULT as object (
IND_QUESTION number,
N_ANSWER number
);

create or replace type MYSCHEMA.T_QUESTION_RESULT_LIST as table of
T_QUESTION_RESULT;

As you can see, in Oracle, the T_QUESTION_RESULT_LIST was actually of type
table (and T_QUESTION_RESULT was of type object...) I'm basically going
under the assumption that I can duplicate type object with just type in
PostgreSql and type table with type and with the ONE element in the type
being an array.

If I'm way off base, could you let me know?

Thanks!

-James DeMond

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message operationsengineer1 2005-01-31 15:25:56 pgAdminIII and User Grants
Previous Message Bruno Wolff III 2005-01-29 22:23:06 Re: distinct vs group by