Re: Domains vs data types - Mailing list pgsql-general

From Greg Sabino Mullane
Subject Re: Domains vs data types
Date
Msg-id CAKAnmmJfh2hPk8v597tRNVhM9_4oCQmTtJ6CVqHAp4hO0qPj6Q@mail.gmail.com
Whole thread Raw
In response to Domains vs data types  (Ertan Küçükoglu <ertan.kucukoglu@gmail.com>)
Responses Re: Domains vs data types
List pgsql-general
On Wed, Aug 20, 2025 at 12:48 AM Ertan Küçükoglu <ertan.kucukoglu@gmail.com> wrote:
Does the second table have any technical advantage/disadvantage over plain data type definition?
Less metadata in memory? High metadata in memory? Less/increased disk space?

Same disk space. No disadvantage other than confusing your users, and any performance differences will be so minor as to be unmeasurable. (my two cents: domains are best when the data type is complex AND shared across multiple tables. Even then I tend to avoid them.)

Cheers,
Greg

--
Enterprise Postgres Software Products & Tech Support

pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: Streaming replica hangs periodically for ~ 1 second - how to diagnose/debug
Next
From: Greg Sabino Mullane
Date:
Subject: Re: vacuum analyze query performance - help me understand