Re: [HACKERS] Re: [DOCS] Reference Manual

From: "Jose' Soares Da Silva" <sferac(at)proxy(dot)bazzanese(dot)com>
To: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: Jose Soares Da Silva <sferac(at)bo(dot)nettuno(dot)it>, pgsql-hackers(at)postgresql(dot)org, pgsql-docs(at)postgresql(dot)org
Subject: Re: [HACKERS] Re: [DOCS] Reference Manual
Date: 1998-04-01 16:32:29
Message-ID: Pine.LNX.3.96.980401162615.843A-100000@proxy.bazzanese.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 1 Apr 1998, Thomas G. Lockhart wrote:

> > The point is: why EXTRACT accepts only date types ?
> > SQL92 specifies date, time, timestamp and interval.
>
> tgl=> select extract (year from date 'now');
> date_part
> ---------
> 1998
> (1 row)
> tgl=> select extract (year from datetime 'now');
> date_part
> ---------
> 1998
> (1 row)
> tgl=> select extract (year from abstime 'now');
> date_part
> ---------
> 1998
> (1 row)
> tgl=> select extract(year from timestamp 'now');
> date_part
> ---------
> 1998
> (1 row)
> tgl=> select extract (hour from timespan '5 hours');
> date_part
> ---------
> 5
> (1 row)
>
> tgl=> select extract (hour from reltime '5 hours');
> date_part
> ---------
> 5
> (1 row)
> tgl=> select extract (hour from interval '5 hours');
> date_part
> ---------
> 5
> (1 row)
>
> And,
>
> tgl=> select extract (hour from time '03:04:05');
> ERROR: function 'time_timespan(time)' does not exist
>
> This is a known problem; will fix for v6.4.
>
> - Tom
>

It doesn't work for me. Why ??

psql=> select extract (year from current_timestamp);
ERROR: function date_part(unknown, timestamp) does not exist
psql=> select extract (hour from current_time);
ERROR: function time_timespan(time) does not exist
psql=> select extract (minute from current_time);
ERROR: function time_timespan(time) does not exist
psql=> select extract (second from current_time);
ERROR: function time_timespan(time) does not exist
Ciao, Jose'

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-04-01 16:41:45 Re: [HACKERS] Re: [PORTS] Port Bug Report: int2 negative numbers not parsed correctly
Previous Message Sajiah Chmaitelli 1998-04-01 16:28:58 ILLUSTRA DBA CONSULTANT NEEDED ASAP!