Re: Database Design Theory - PostgreSQL Custom Types

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Redefined Horizons <redefined(dot)horizons(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Database Design Theory - PostgreSQL Custom Types
Date: 2006-07-26 20:34:49
Message-ID: 20060726203449.GC32377@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Reece Hart 2006-07-26 20:38:38 Re: copy losing information
Previous Message Silvela, Jaime (Exchange) 2006-07-26 20:27:22 Re: copy losing information