Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kN0kA-0007mW-A7 for pgsql-general@arkaria.postgresql.org; Mon, 28 Sep 2020 21:31:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kN0k9-00033V-8Z for pgsql-general@arkaria.postgresql.org; Mon, 28 Sep 2020 21:31:33 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kN0k9-00033O-14 for pgsql-general@lists.postgresql.org; Mon, 28 Sep 2020 21:31:33 +0000 Received: from freedomcircle.com ([208.71.169.155] helo=mail.freedomcircle.com) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kN0k2-0007oo-Iw for pgsql-general@lists.postgresql.org; Mon, 28 Sep 2020 21:31:32 +0000 Received: from [192.168.1.7] (unknown [173.170.129.0]) by mail.freedomcircle.com (Postfix) with ESMTPSA id 1A9572A042; Mon, 28 Sep 2020 21:31:24 +0000 (UTC) Subject: Re: DOMAIN/composite TYPE vs. base TYPE To: Rob Sargent Cc: pgsql-general@lists.postgresql.org References: <6198aad8-df09-569e-686b-7e32979cd7e4@freedomcircle.com> <0E2C98A4-7228-4FCE-9F22-328F0543F4F0@gmail.com> From: Joe Abbate Message-ID: <3032f56a-3a5c-682b-512e-af6e8cb363d1@freedomcircle.com> Date: Mon, 28 Sep 2020 17:31:23 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <0E2C98A4-7228-4FCE-9F22-328F0543F4F0@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello Rob, On 28/9/20 17:17, Rob Sargent wrote: > just record all three fields (day, month, year) with nulls and do the to-date as needed. That is not sufficient. An earlier implementation had something like a CHAR(8) to record YYYYMMDD, but how can you indicate, for example, an issue date of a bimonthly magazine, say July-Aug 2020? We can store 2020-07-01 in the DATE attribute, but we need another attribute to indicate it's really two months. Also, by storing three separate columns, you loose the beauty of the PG DATE abstraction. Joe