Skip site navigation (1) Skip section navigation (2)

Re: BUG #4207: EXTRACT function

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: Jeferson Kasper <jefersonkasper(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4207: EXTRACT function
Date: 2008-05-29 11:25:16
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
On Thu, May 29, 2008 at 07:01:46AM +0000, Jeferson Kasper wrote:
> the EXTRACT(field FROM source) function allows to use some kind of 'fields',
> and i need to know if a time (like '07:00') is after the midday(12:00) or
> not.
> I know i can resolve it implementing some function like "select
> ('07:00'<'12:00')".. i just want to know if is difficult to implement a new
> field called 'am', to use like.
> select extract(AM from '07:00');

What's wrong with just doing:

  SELECT extract(hour FROM date) < 12;


In response to

pgsql-bugs by date

Next:From: Dave PageDate: 2008-05-29 11:28:44
Subject: Re: BUG #4186: set lc_messages does not work
Previous:From: Thomas H.Date: 2008-05-29 11:23:21
Subject: Re: BUG #4186: set lc_messages does not work

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group