Re: DOMAIN/composite TYPE vs. base TYPE

Поиск
Список
Период
Сортировка
От Ron
Тема Re: DOMAIN/composite TYPE vs. base TYPE
Дата
Msg-id ca40d2ad-eb1a-7d64-6911-366550336974@gmail.com
обсуждение исходный текст
Ответ на Re: DOMAIN/composite TYPE vs. base TYPE  (Joe Abbate <jma@freedomcircle.com>)
Список pgsql-general
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 genealogy program has figured it out; maybe it's source code can lend you some clues.

--
Angular momentum makes the world go 'round.

В списке pgsql-general по дате отправления:

Предыдущее
От: Joe Abbate
Дата:
Сообщение: Re: DOMAIN/composite TYPE vs. base TYPE
Следующее
От: "Gavan Schneider"
Дата:
Сообщение: Re: DOMAIN/composite TYPE vs. base TYPE