Re: DOMAIN/composite TYPE vs. base TYPE

From: Joe Abbate <jma(at)freedomcircle(dot)com>
To: Rob Sargent <robjsargent(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: DOMAIN/composite TYPE vs. base TYPE
Date: 2020-09-28 21:31:23
Message-ID: 3032f56a-3a5c-682b-512e-af6e8cb363d1@freedomcircle.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2020-09-28 21:49:55 Re: DOMAIN/composite TYPE vs. base TYPE
Previous Message Tom Lane 2020-09-28 21:25:17 Re: DOMAIN/composite TYPE vs. base TYPE