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

From James DeMond
Subject Re: Arrays of user-defined data types in other user-defined
Date
Msg-id Pine.GSO.4.58.0502011056120.27063@torch.cs.dal.ca
Whole thread Raw
In response to Re: Arrays of user-defined data types in other user-defined data types  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice

Well, from what I have read, oracle has 3 types that can be defined:
objects, tables and views (possibly more?) I'm basically working under the
assumption that

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

is the same as

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

meaning that types in postgresql map directly as type object in Oracle.
Now, Oracle basically defines type table as an indexed one column "table",
with that column being of some defined (or user) type (... as table of
type number... etc). I really have no clue how to map that functionality
to postgresql. I'm taking a shot that I can do something similar by
defining a type with one item in it where that item is an array of some
type. If anyone has a better idea, I'd be very interested in hearing it.

Thanks for the reply though! It certainly is helping me understand a few
things.

-James DeMond


pgsql-novice by date:

Previous
From: "Rodolfo J. Paiz"
Date:
Subject: Re: some help
Next
From: Neil Conway
Date:
Subject: Re: [HACKERS] Last ID Problem