Re: Domains vs data types

From: Florents Tselai <florents(dot)tselai(at)gmail(dot)com>
To: Ertan Küçükoglu <ertan(dot)kucukoglu(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Domains vs data types
Date: 2025-08-20 17:36:52
Message-ID: 524E00FE-DBFF-483B-A276-467A0B979B1D@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On 20 Aug 2025, at 7:47 AM, Ertan Küçükoglu <ertan(dot)kucukoglu(at)gmail(dot)com> wrote:
>
> Hello,
>
> I am using PostgreSQL 17.6.
> I would like to learn if there is any benefit of using domains over data types for table column definitions in terms of performance gain/loss.
>

I know that this doesn’t answer your question, but before exploring custom types / domains,
and based on experience, I’d strongly recommend exploring jsonb instead as an alternative.

Also note that using custom types can lead to some confusion initially for basic stuff
you can’t do things like SELECT mytype.f1 and instead you have to do (mytype).f1
Things like this can get annoying pretty quickly.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2025-08-20 17:45:13 Re: Streaming replica hangs periodically for ~ 1 second - how to diagnose/debug
Previous Message Thom Brown 2025-08-20 17:30:00 Re: Streaming replica hangs periodically for ~ 1 second - how to diagnose/debug