Re: Bug and/or feature? Complex data types in tables...

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: "Chris Travers" <chris(at)travelamericas(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-15 08:58:16
Message-ID: F5060B4A-4738-11D8-B443-000A95C88220@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Hi Chris,

I know this thread is a little old, but it's something I'm interested
in learning more about.

On Jan 2, 2004, at 9:59 PM, Chris Travers wrote:
> 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 :-( )

Could you explain this a little more? My strengths (such as they are)
are more on relational theory rather than implementation.

My interpretation of what you're saying (which is probably just
restating what's obvious to others) is that there isn't a way to define
the input and output functions in (the PostgreSQL flavor of) SQL. You
have to do it in C, as described in the "User-Defined Types" section
(33.10).

I'm unclear about what follows. Using SELECT complex::text FROM mytable
would be used to get data out of the table. How would you get it in?
How do user-defined casts help out with this?

Thanks for your time! I'm slowing trying to learn here. I'm interested
in figuring out how to implement point and interval/duration types for
temporal work, but know I have a lot to learn to make this possible.

Michael Glaesemann
grzm myrealbox com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nick Barr 2004-01-15 09:05:35 Re: Using regular expressions in LIKE
Previous Message Keith C. Perry 2004-01-15 08:26:20 Re: Postgress and MYSQL

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Glaesemann 2004-01-15 09:18:59 Re: Bug and/or feature? Complex data types in tables...
Previous Message Claudio Natoli 2004-01-15 07:29:21 Re: [pgsql-hackers-win32] Win32 signal code - first try