Domains as typedefs: Performance and automatic casting

Поиск
Список
Период
Сортировка
От hernan gonzalez
Тема Domains as typedefs: Performance and automatic casting
Дата
Msg-id BANLkTik50wPxK7MsCkPqYo_LqsAwKHxmZA@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
I plan to define two domains with no contraints, sort of typedefs, to
work with date-times inside my application:

 CREATE DOMAIN instant AS timestamp(3) with time zone;
 CREATE DOMAIN localdatetime AS timestamp(3) without time zone;

Two questions:

1. I guess that there is no performance penalty in using such a DOMAIN
Am I right?

2. I see that PG does automatic (implicit casting)  between  TIMESTAMP
WITH/WITHOUT TIME ZONE types,
it accept one type in place of the other (a dangerous thing, IMO, as
the conversion is sensitive to the current
timezone) ; the same happens for these DOMAINs .
I guess that I must live with this, now way to disallow it... Am I right?

Hernán J. González

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

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: Postgres performance and the Linux scheduler
Следующее
От: Mike Christensen
Дата:
Сообщение: Re: Constraint to ensure value does NOT exist in another table?