composite data type question

Started by Jessica M Salmonalmost 20 years ago3 messagesgeneral
Jump to latest
#1Jessica M Salmon
jmsalmon@fs.fed.us

Hello all.

I am brand new to creating my own data types in postgres. I first created a
type called "indices", containing two integers. Now, I want to create
another type, called "progress", which should contain one timestamp and an
array of "indices". However, I cannot figure out how to get postgres to
recognize the array of my home-brewed composite data type as a valid data
type. Can I just insert a new element into the pg_type table, for a type
called "_indices"?

Any hints or advice greatly appreciated.

TIA,
Meghan

#2Michael Fuhr
mike@fuhr.org
In reply to: Jessica M Salmon (#1)
Re: composite data type question

On Tue, Jun 06, 2006 at 11:40:05AM -0600, Jessica M Salmon wrote:

I am brand new to creating my own data types in postgres. I first created a
type called "indices", containing two integers. Now, I want to create
another type, called "progress", which should contain one timestamp and an
array of "indices". However, I cannot figure out how to get postgres to
recognize the array of my home-brewed composite data type as a valid data
type. Can I just insert a new element into the pg_type table, for a type
called "_indices"?

http://www.postgresql.org/docs/8.1/interactive/arrays.html

"Arrays of any built-in or user-defined base type can be created.
(Arrays of composite types or domains are not yet supported,
however.)"

What are you trying to model? Have you considered other ways of
representing it?

--
Michael Fuhr

#3Jessica M Salmon
jmsalmon@fs.fed.us
In reply to: Michael Fuhr (#2)
Re: composite data type question

Thanks Michael.
I suppose I will have to find another way to represent the data, yes.
We are tracking fire progress across a landscape, based on processing of
MODIS (http://modis.gsfc.nasa.gov/) data.
Thanks again,
Meghan

Michael Fuhr
<mike@fuhr.org>
To
06/07/2006 07:59 Jessica M Salmon
AM <jmsalmon@fs.fed.us>
cc
pgsql-general@postgresql.org
Subject
Re: [GENERAL] composite data type
question

On Tue, Jun 06, 2006 at 11:40:05AM -0600, Jessica M Salmon wrote:

I am brand new to creating my own data types in postgres. I first created

a

type called "indices", containing two integers. Now, I want to create
another type, called "progress", which should contain one timestamp and

an

array of "indices". However, I cannot figure out how to get postgres to
recognize the array of my home-brewed composite data type as a valid data
type. Can I just insert a new element into the pg_type table, for a type
called "_indices"?

http://www.postgresql.org/docs/8.1/interactive/arrays.html

"Arrays of any built-in or user-defined base type can be created.
(Arrays of composite types or domains are not yet supported,
however.)"

What are you trying to model? Have you considered other ways of
representing it?

--
Michael Fuhr