public inbox for [email protected]  
help / color / mirror / Atom feed
From: Florents Tselai <[email protected]>
To: Ertan Küçükoglu <[email protected]>
Cc: [email protected]
Subject: Re: Domains vs data types
Date: Wed, 20 Aug 2025 20:36:52 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAH2i4yf_M5NfX_kDu6_2Z+sgqLOZK9vCsF3EfmwZQyYFuAMxpg@mail.gmail.com>
References: <CAH2i4yf_M5NfX_kDu6_2Z+sgqLOZK9vCsF3EfmwZQyYFuAMxpg@mail.gmail.com>



> On 20 Aug 2025, at 7:47 AM, Ertan Küçükoglu <[email protected]> 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.










view thread (3+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Domains vs data types
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox