pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: DOMAIN/composite TYPE vs. base TYPE
Date: Mon, 28 Sep 2020 16:49:55 -0500
Message-ID: <ca40d2ad-eb1a-7d64-6911-366550336974@gmail.com> (raw)
In-Reply-To: <3032f56a-3a5c-682b-512e-af6e8cb363d1@freedomcircle.com>
References: <6198aad8-df09-569e-686b-7e32979cd7e4@freedomcircle.com>
	<0E2C98A4-7228-4FCE-9F22-328F0543F4F0@gmail.com>
	<3032f56a-3a5c-682b-512e-af6e8cb363d1@freedomcircle.com>

On 9/28/20 4:31 PM, Joe Abbate wrote:
> 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.

The Gramps <https://gramps-project.org/blog/; genealogy program has figured 
it out; maybe it's source code can lend you some clues.

-- 
Angular momentum makes the world go 'round.

view thread (10+ messages)  latest in thread

Message-ID: <ca40d2ad-eb1a-7d64-6911-366550336974@gmail.com>
Permalink:  ../ca40d2ad-eb1a-7d64-6911-366550336974@gmail.com/
Also on:    postgresql.org/message-id/ca40d2ad-eb1a-7d64-6911-366550336974@gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: DOMAIN/composite TYPE vs. base TYPE
  In-Reply-To: <ca40d2ad-eb1a-7d64-6911-366550336974@gmail.com>
  References: <6198aad8-df09-569e-686b-7e32979cd7e4@freedomcircle.com> <0E2C98A4-7228-4FCE-9F22-328F0543F4F0@gmail.com> <3032f56a-3a5c-682b-512e-af6e8cb363d1@freedomcircle.com> <ca40d2ad-eb1a-7d64-6911-366550336974@gmail.com>

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

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