Re: What are the characteristics of a good user-defined data type?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Tim Hart" <tjhart(at)mac(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: What are the characteristics of a good user-defined data type?
Date: 2006-06-07 14:36:31
Message-ID: 29852.1149690991@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Tim Hart" <tjhart(at)mac(dot)com> writes:
> I've reviewed the PostgreSQL documentation on user defined data types. It
> seems that data types that can't be ordered or compared for equality would
> be bad candidates. After all, if a data type can't be indexed or used in a
> where clause, what value does a custom type bring over a binary or textual
> representation?

Well, the possibility of error-checking for bad values might alone
justify a custom type, depending on what you're doing. A type with no
support beyond the required I/O functions could offer that.

But it's kinda hard to imagine a datatype in which there is no
meaningful way to define equality ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jonathon McKitrick 2006-06-07 14:44:57 Re: Problem with 'postgres' db with 8.0 on a MacBook
Previous Message Tony Caduto 2006-06-07 14:34:38 Re: Import Data from MS SQL Server