From: | "Chris Travers" <chris(at)travelamericas(dot)com> |
---|---|
To: | "Michael Glaesemann" <grzm(at)myrealbox(dot)com> |
Cc: | <pgsql-general(at)postgresql(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Subject: | Re: Bug and/or feature? Complex data types in tables... |
Date: | 2004-01-03 03:59:44 |
Message-ID: | 008f01c3d1b9$4f947470$1800053d@winxp |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-hackers |
> (To avoid confusion since we're talking about complex numbers, I'm
> assuming you mean what PostgreSQL refers to as composite types.) It
> definitely would be nice to be able to define composite types that can
> be used as attributes and functions. It seems like there's quite a bit
> of, er, functionality with composite types already. I don't have
> pl/pgsql installed, but I was able to create some simple operators with
> just SQL (see below). They're not perfect (and don't let us use
> composite types in tables); just exploring what I could do. I wonder
> what it would take to allow these user-defined types defined in
> PostgreSQL (rather than C) usable in tables.
AFAICS, there are only one thing missing and it could probably be worked
around if the backend did nto crash when you try to retrieve the information
via a casting function. It is:
Some way to define a standard input and output representation (how it is
done in C).
If you can define your own casts, you can then select complex::text from
mytable (but this would crash the backend again :-( )
Of course for complex numbers, you might be able use a domain off of points,
and then define special operators for them (for example, adding complex
numbers is meaningful, but adding points is not). But this might not work
for other sorts of types.
Best Wishes,
Chris Travers
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2004-01-03 05:31:10 | Re: Bug and/or feature? Complex data types in tables... |
Previous Message | Marc G. Fournier | 2004-01-03 00:29:27 | Re: [GENERAL] postgresql.org server problems |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2004-01-03 05:31:10 | Re: Bug and/or feature? Complex data types in tables... |
Previous Message | Joe Conway | 2004-01-03 02:08:33 | Re: PL/Java issues |