[RFC] allow 'semester' in functions EXTRACT, DATE_PART, TO_CHAR and so on.

From: "Dickson S(dot) Guedes" <listas(at)guedesoft(dot)net>
To: pg-dev <pgsql-hackers(at)postgresql(dot)org>
Subject: [RFC] allow 'semester' in functions EXTRACT, DATE_PART, TO_CHAR and so on.
Date: 2015-08-14 23:58:55
Message-ID: CAHHcrer7MkXTH7tiUkPt-PPYTXKKuYjbHO_jZPUCkGeVAsq1Fg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello hackers,

* Description

This patch is a proposal to allow the use of word 'semester' to
extract it from date in functions like EXTRACT, DATE_PART, etc and
adds the letter 'S' to format the date output in to_char.

** Example

SELECT EXTRACT(semester FROM DATE '2015-07-07');

date_part
-----------
2

* Motivation

The term is used in a school or college to represent a half-year.
Actually it could be evaluated from a date using some math with
'quarter' but could not be extracted from date since the API to define
a "reserved word" for EXTRACT is in the core, rather than in SQL.

* Syntax

I'm using the word 'semester' since it is common in college and school
but I wondering if it should be other word (like 'halfyear', for
example)

Is this a feature that worth?

BTW, I'll put this in the commit fest (2015-09).

Thanks!
--
Dickson S. Guedes
mail/xmpp: guedes(at)guedesoft(dot)net - skype: guediz
http://github.com/guedes - http://guedesoft.net
http://www.postgresql.org.br

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dickson S. Guedes 2015-08-15 00:09:58 Re: [RFC] allow 'semester' in functions EXTRACT, DATE_PART, TO_CHAR and so on.
Previous Message Tom Lane 2015-08-14 21:18:22 Re: alter-table-1 isolation test spec contains a duplicate step name