Re: Database Design Theory - PostgreSQL Custom Types - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Database Design Theory - PostgreSQL Custom Types
Date
Msg-id 20060726203449.GC32377@svana.org
Whole thread Raw
In response to Database Design Theory - PostgreSQL Custom Types  ("Redefined Horizons" <redefined.horizons@gmail.com>)
Responses Re: Database Design Theory - PostgreSQL Custom Types  (Scott Ribe <scott_ribe@killerbytes.com>)
List pgsql-general
On Wed, Jul 26, 2006 at 11:09:22AM -0700, Redefined Horizons wrote:
> I'm trying to come up with some good rules of thumb that can help me
> determine when it is practical to implement a custom type on
> PostgreSQL.

To me a custom datatype is useful when there is a set of values where
you have operations that map to other values in the set.

So numbers and strings are good because you have operations on them
that produce more numbers and strings. Your example with angles is good
also, since you can add and subtract them. Timestamps, intervals and
geometric types are also good.

Most things in the world don't work that way: you can't take two
customers and make a third. I'm sure there's a mathematical way to
express this better but I hope this helps,

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: "Silvela, Jaime \(Exchange\)"
Date:
Subject: Re: copy losing information
Next
From: Alvaro Herrera
Date:
Subject: Re: copy losing information