[RFC] allow 'semester' in functions EXTRACT, DATE_PART, TO_CHAR and so on. - Mailing list pgsql-hackers

From Dickson S. Guedes
Subject [RFC] allow 'semester' in functions EXTRACT, DATE_PART, TO_CHAR and so on.
Date
Msg-id CAHHcrer7MkXTH7tiUkPt-PPYTXKKuYjbHO_jZPUCkGeVAsq1Fg@mail.gmail.com
Whole thread Raw
Responses Re: [RFC] allow 'semester' in functions EXTRACT, DATE_PART, TO_CHAR and so on.  ("Dickson S. Guedes" <listas@guedesoft.net>)
Re: [RFC] allow 'semester' in functions EXTRACT, DATE_PART, TO_CHAR and so on.  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
Re: [RFC] allow 'semester' in functions EXTRACT, DATE_PART, TO_CHAR and so on.  ("David G. Johnston" <david.g.johnston@gmail.com>)
List 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@guedesoft.net - skype: guediz
http://github.com/guedes - http://guedesoft.net
http://www.postgresql.org.br



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: alter-table-1 isolation test spec contains a duplicate step name
Next
From: "Dickson S. Guedes"
Date:
Subject: Re: [RFC] allow 'semester' in functions EXTRACT, DATE_PART, TO_CHAR and so on.