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

From: Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>
To: "Dickson S(dot) Guedes" <listas(at)guedesoft(dot)net>, pg-dev <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [RFC] allow 'semester' in functions EXTRACT, DATE_PART, TO_CHAR and so on.
Date: 2015-08-15 00:32:44
Message-ID: 55CE88AC.9000101@archidevsys.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2015-08-15 00:40:34 Re: [RFC] allow 'semester' in functions EXTRACT, DATE_PART, TO_CHAR and so on.
Previous Message Dickson S. Guedes 2015-08-15 00:09:58 Re: [RFC] allow 'semester' in functions EXTRACT, DATE_PART, TO_CHAR and so on.