Re: Database Design Theory - PostgreSQL Custom Types

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Database Design Theory - PostgreSQL Custom Types
Дата
Msg-id 20060726203449.GC32377@svana.org
обсуждение исходный текст
Ответ на Database Design Theory - PostgreSQL Custom Types  ("Redefined Horizons" <redefined.horizons@gmail.com>)
Ответы Re: Database Design Theory - PostgreSQL Custom Types  (Scott Ribe <scott_ribe@killerbytes.com>)
Список 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.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: "Silvela, Jaime \(Exchange\)"
Дата:
Сообщение: Re: copy losing information
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: copy losing information