Domains as typedefs: Performance and automatic casting - Mailing list pgsql-general

From hernan gonzalez
Subject Domains as typedefs: Performance and automatic casting
Date
Msg-id BANLkTik50wPxK7MsCkPqYo_LqsAwKHxmZA@mail.gmail.com
Whole thread Raw
List 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 by date:

Previous
From: Greg Smith
Date:
Subject: Re: Postgres performance and the Linux scheduler
Next
From: Mike Christensen
Date:
Subject: Re: Constraint to ensure value does NOT exist in another table?