Arrays of user-defined data types in other user-defined data types - Mailing list pgsql-novice

From James DeMond
Subject Arrays of user-defined data types in other user-defined data types
Date
Msg-id Pine.GSO.4.58.0501310002460.23121@torch.cs.dal.ca
Whole thread Raw
Responses Re: Arrays of user-defined data types in other user-defined data types
List 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

pgsql-novice by date:

Previous
From: Michael Guerin
Date:
Subject: Function to blame?
Next
From: Tom Lane
Date:
Subject: Re: Function to blame?