Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uom7T-009y1y-9E for pgsql-general@arkaria.postgresql.org; Wed, 20 Aug 2025 16:57:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uom7S-009vCH-Av for pgsql-general@arkaria.postgresql.org; Wed, 20 Aug 2025 16:57:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uom7S-009vC9-0C for pgsql-general@lists.postgresql.org; Wed, 20 Aug 2025 16:57:02 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uom7P-000wfN-39 for pgsql-general@lists.postgresql.org; Wed, 20 Aug 2025 16:57:01 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-6188b5ad4f0so185845a12.0 for ; Wed, 20 Aug 2025 09:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755709018; x=1756313818; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=c8UdUhD/ocASSVFkhJwEjqFffggxRQeKfK8B57Kv1pE=; b=Vf+uaQEkqIGZn2RLBgcqIPfy+Y810w6kiUb18JTwp15DUgCLf8RU61Tt9vsdvvQh6d +sHdIJwYg63afuu8upjjW5IV7Qd99eelXLCHN2uPXS2M2gGUM/4/1MY7c2y9E2mpVNvD 9t8azYWlw7+/h6JZVBDOyeFgGrTM6O83LoYPKuYBA7JI/3BYzC6z07mFUiEHGStmt5P3 xZ9TdRAUI9MLZrAi7In64pHt8uTBbAUy8bEFZyzoUo53NewloEI7b+ukbYi/Rvw7DnaE QzWRnQeUB5topxqnmv5R5Q9an2oBqY9kdehttOuDTKB4g38PVqL6Nhxss5KmK35AeVrU 4pig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755709018; x=1756313818; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=c8UdUhD/ocASSVFkhJwEjqFffggxRQeKfK8B57Kv1pE=; b=lIl2VOfoQToJkcmk5Nupx2HhPZ72liQMXV4vzu2quldPbvUh1+mhFm2WQI1MbuaUtA tU44e/NFfvHrQMBQOlPTCEm2Sw+0TJG50zrCcSKkG47jqyl8t0VNuyQsIK2oYBn++5VI XNuarbnQnCjmkQ5XluW/WyR7PkblZgRuW7hQiaHfv0HsUJWHU934kuQFpVgiIWg19fSw hbUWV/RKGsuXti4NM95LbKbhe9mEnFpaUQTPYljO6gBYZaHlz39CJcLcUhjFYT6RcD7o zb3lisq9021GVdpTmC0UA2xDAYmbwAtdoeu3v60/led9KLFi9tDnXiQLhTo667tk5odj WOWQ== X-Forwarded-Encrypted: i=1; AJvYcCWwUqAPVMw8tSp4w88BwBSvtBRHlAYZd/P8dKlFzF8FHjF+IE/+drqGmzwldvvv3yirYjy3hwQ5cXk4Adaj@lists.postgresql.org X-Gm-Message-State: AOJu0Yx5G4Mvs43t+nWQanEuYFqg+MJYc4G395OVKIU5yDpayO/i7o9W zAB00cEGkAg5SF7XPr4VfmBVjyT2bjky6yaKFMrRJNKsQ5hrBYpiSLWJej+X68yIJatGTUzEkeT 98e2j5SdCRbSaRZajJB///n1oZVmcurOZNw== X-Gm-Gg: ASbGncueItUnbOTFB7ne2PHXZGSxLnsldx0zqJ93Haf4sh/PW250/Ro7dRIIOZcMAbY Y0yeITQH7nG7oLsl8zGhAqRWOxc/LoqQDlXr+crem4bBLuwtEmVf858TG3ytC9CNBODVU/e1NdE EnxuL9lZSxOA8chnYDu2/A9eyD/R1qsD6GaNbtIahHaa2wabt+fHFLb1yhMGGPHLN+bTsuhoMf3 EV8PcE= X-Google-Smtp-Source: AGHT+IHkBIaF3ON+fxGqR1SYVUc6wdeQAebAoNptPUmC08ecFfKITGZjaA1DUHpHS5DM02O4EOooOdyGhTLp65XzGbU= X-Received: by 2002:a05:6402:1e93:b0:618:34cc:25a6 with SMTP id 4fb4d7f45d1cf-61a9755ccc6mr2858143a12.13.1755709018187; Wed, 20 Aug 2025 09:56:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ron Clarke Date: Wed, 20 Aug 2025 18:56:47 +0200 X-Gm-Features: Ac12FXya7C4qRqeO4sN6iuJ0KO1dqMCStSgW-UeyBwVfQspmhLfuFS9vnjYQhZY Message-ID: Subject: Re: Domains vs data types To: Greg Sabino Mullane Cc: =?UTF-8?B?RXJ0YW4gS8O8w6fDvGtvZ2x1?= , pgsql-general Content-Type: multipart/alternative; boundary="0000000000005bac9f063ccedc8d" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005bac9f063ccedc8d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Opinion: domains are useful if you give them names that are full of meaning. For example if you have the same type of data accross tables "item_number" or "account" etc so that you can use them to describe what you want stored in them and ensure the same defaults, nulls etc are applied accross tables. Having randomly named or encoded lists just makes life more complicated. On Wed, 20 Aug 2025, 18:13 Greg Sabino Mullane, wrote: > On Wed, Aug 20, 2025 at 12:48=E2=80=AFAM Ertan K=C3=BC=C3=A7=C3=BCkoglu < > 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 > > -- > Crunchy Data - https://www.crunchydata.com > Enterprise Postgres Software Products & Tech Support > > --0000000000005bac9f063ccedc8d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Opinion: domains are useful if you give them names that a= re full of meaning. For example if you have the same type of data accross t= ables "item_number" or "account" etc so that you can us= e them to describe what you want stored in them and ensure the same default= s, nulls etc are applied accross tables. Having randomly named or encoded l= ists just makes life more complicated.

On Wed, 20 Aug = 2025, 18:13 Greg Sabino Mullane, <= htamfids@gmail.com> wrote:
<= div dir=3D"ltr">
On Wed, Aug 20, 2025 at 12:48=E2=80=AFAM E= rtan K=C3=BC=C3=A7=C3=BCkoglu <ertan.kucukoglu@gmail.com> = wrote:
Does the second table have any technica= l advantage/disadvantage over plain data type definition?
Less me= tadata in memory? High metadata in memory? Less/increased disk space?
=

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

Cheers,
Greg

--=
Enter= prise Postgres Software Products & Tech Support

--0000000000005bac9f063ccedc8d--