On 15/08/15 11:58, Dickson S. Guedes wrote:
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!
Note that the start and end points for a semester might well be different between universities in the Northern & Southern Hemispheres of this planet- also between institutions in the same hemisphere.

The first semester in 2015 for the University of Auckland begins Monday 2 March 2015:
https://www.auckland.ac.nz/en/for/current-students/cs-academic-information/cs-academic-dates.html

The first semester in 2015 for ANU (Australian National University) begins Monday 16 February 2015:
http://www.anu.edu.au/directories/university-calendar

So semesters don't appear to align with normal half year boundaries.


Cheers,
Gavin


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to