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 1rfUuX-000XjG-DI for pgsql-general@arkaria.postgresql.org; Thu, 29 Feb 2024 01:08:33 +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 1rfUuV-00GNCv-UJ for pgsql-general@arkaria.postgresql.org; Thu, 29 Feb 2024 01:08:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rfUuV-00GNCn-K1 for pgsql-general@lists.postgresql.org; Thu, 29 Feb 2024 01:08:32 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rfUuS-001xx2-5R for pgsql-general@postgresql.org; Thu, 29 Feb 2024 01:08:30 +0000 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1dcce5e84bcso4009705ad.1 for ; Wed, 28 Feb 2024 17:08:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709168907; x=1709773707; darn=postgresql.org; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=M1lR24b47rNuCvO6QQ3fphvGMioLvqE6yYFShwj3Dgg=; b=PQPUpbTtXaWdcNtLC8sZLtdb07iR9vP2QlS2y5dRc/Wx/dP6mwt4e+eh7N2rpmaPeM Cr7tk7NIjTfsVaikzgLT8OeR4tE7+WB5PmApNm0m8Ls3PIOLN6G6rOgm4EXewXNgJv9L cZZA8QVywYMABvOxDDN55VxTa74JVWzjCCcXHfh3s4IPijkiGYRlkDaM33culK/3fxOq C0/514qgk+VTm/4uurMyZG+X1LMldUnSJrJf1aCnVRqORzOLzCLBNchKnGlNf5QCMV4E yfGGEpXKILNotABBjoOITl96S7nPUtxdBpGkelh4NRmIGNi2XDjCzKzWROGYjgp05X92 vu2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709168907; x=1709773707; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=M1lR24b47rNuCvO6QQ3fphvGMioLvqE6yYFShwj3Dgg=; b=gkBPevhdyHTfGZ+g/4wPAyY0wU+fALX4iajzQm+IBAE5Ekl+hXCoLlAjFx8DS8kGzy fVOPdtrcU9D0uEdVAZ6RqqizWgoGZ7OzjWYS7jrGoSJu8bOZ50AZFjKeloZG2RzLDZ0I WUEzGVw0Swesoo3FflhRR81MFaNlNFpIgZEUjX0xDTna+0EWb3VUnW8Pb2xMFvGWFcKG /Gblmr6Af/Z61bd3T400LE5rOBgSdcN9uDZhy2cZ15jidyEeudxzMdX5lCl2ZJSQW5I8 /zDETpqkyHAyO7zY2tQ5J9OMODTO6p228sJrhbUKgzqLdx1znA3/DnhA5ZgJJVxI70+K hn3g== X-Gm-Message-State: AOJu0YyfcAtm0+hJeCRY7SVYResLe6qnjsWb/uTpeurqmDGyWVk/8yye MrsNRHEg+CaLf01pCBxxNkBo29pk7vUwd1LflVktnfl5j8K6Pmqc0CyRC33V X-Google-Smtp-Source: AGHT+IG1MW+APJmUXaAdZq4FR5/44m9P66d5ZNIDs72imVmmlQvy7gbCJ62KP5N1tO1wHEl1Rz27AQ== X-Received: by 2002:a17:902:da8c:b0:1dc:78ea:1ae with SMTP id j12-20020a170902da8c00b001dc78ea01aemr883854plx.26.1709168907012; Wed, 28 Feb 2024 17:08:27 -0800 (PST) Received: from smtpclient.apple ([2600:8801:8600:631::a]) by smtp.gmail.com with ESMTPSA id f7-20020a170902ce8700b001db604f41dcsm87947plg.103.2024.02.28.17.08.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Feb 2024 17:08:26 -0800 (PST) From: Guyren Howe Content-Type: multipart/alternative; boundary="Apple-Mail=_11BDABA2-E37E-4B0C-80C9-2A6B9C8DEA1B" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Subject: Content for talk on Postgres Type System at PostgresConf Message-Id: Date: Wed, 28 Feb 2024 17:08:00 -0800 To: Postgres General X-Mailer: Apple Mail (2.3774.300.61.1.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail=_11BDABA2-E37E-4B0C-80C9-2A6B9C8DEA1B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I am to talk about Postgres=E2=80=99s type system at PGConf: = https://postgresconf.org/conferences/2024/program/proposals/postgres-s-typ= e-system I picked the issue because I think it=E2=80=99s poorly understood, = greatly under-discussed, and an excellent way to empower postgres users. I am reasonably conversant with the issue. I=E2=80=99m not looking for = others to write the talk for me, but in order to make the best talk I = can, I=E2=80=99m asking: What would you want to see in such a talk? I=E2=80=99m planning on covering: - The built-in types that are underused and their advantages (eg inet) - domains - such things as details of arrays including multidimensional arrays - user-defined types, their relationship to tables, and generally how to = use them I would spend most of the time discussing ways to make effective use of = types. Some examples: - defining functions of rows so the table can be used kind of like a set = of objects (including the dot notation for invoking functions) - using UDFs to make code clearer eg if you have an idiosyncratic = functional index, define it using a function of the row, so it=E2=80=99s = easy to get right when querying - using UDFs as a kind of better domain. eg differentiating imperial = from metric units by requiring an explicit constructor, not just = accepting any old number I would mention enumerated types, although I=E2=80=99m inclined to = advise that their inflexibility (eg can=E2=80=99t delete or rearrange = them) means that a related table is probably better (I=E2=80=99d be = delighted to be proved wrong). Custom Range Types are an interesting feature, but I can=E2=80=99t think = of a good use case. Any good examples? Automatic casting is a feature I=E2=80=99m aware of, but I=E2=80=99d be = interested in any cool use cases. Anything I=E2=80=99m missing? Any existing good discussions of the = subject?= --Apple-Mail=_11BDABA2-E37E-4B0C-80C9-2A6B9C8DEA1B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 I am to talk = about Postgres=E2=80=99s type system at PGConf:


I picked the = issue because I think it=E2=80=99s poorly understood, greatly = under-discussed, and an excellent way to empower postgres = users.

I am reasonably conversant with the = issue. I=E2=80=99m not looking for others to write the talk for me, but = in order to make the best talk I can, I=E2=80=99m = asking:

What would you want to see in such a = talk?

I=E2=80=99m planning on = covering:

- The built-in types that are = underused and their advantages (eg inet)
- domains
- = such things as details of arrays including multidimensional = arrays
- user-defined types, their relationship to tables, and = generally how to use them

I would spend most of = the time discussing ways to make effective use of types. Some = examples:
- defining functions of rows so the table can be = used kind of like a set of objects (including the dot notation for = invoking functions)
- using UDFs to make code clearer eg if = you have an idiosyncratic functional index, define it using a function = of the row, so it=E2=80=99s easy to get right when querying
- = using UDFs as a kind of better domain. eg differentiating imperial from = metric units by requiring an explicit constructor, not just accepting = any old number

I would mention enumerated = types, although I=E2=80=99m inclined to advise that their inflexibility = (eg can=E2=80=99t delete or rearrange them) means that a related table = is probably better (I=E2=80=99d be delighted to be proved = wrong).

Custom Range Types are an interesting = feature, but I can=E2=80=99t think of a good use case. Any good = examples?

Automatic casting is a feature I=E2=80=99= m aware of, but I=E2=80=99d be interested in any cool use = cases.


Anything I=E2=80=99m = missing? Any existing good discussions of the = subject?
= --Apple-Mail=_11BDABA2-E37E-4B0C-80C9-2A6B9C8DEA1B--