Re: date_part vs extract

From: Brent Verner <brent(at)rcfile(dot)org>
To: Markus Bertheau <twanger(at)bluetwanger(dot)de>
Cc: postgres sql list <pgsql-sql(at)postgresql(dot)org>
Subject: Re: date_part vs extract
Date: 2001-11-29 09:48:39
Message-ID: 20011129094839.GB11369@rcfile.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 29 Nov 2001 at 09:45 (+0100), Markus Bertheau wrote:
| I wonder about the difference between date_part('week', ...) and
| extract(week from ...) not only but also from a performance point of
| view. I read extract is standard and date_part is not. Backwards
| compatibility maybe justifies the existence of date_part. Whats else?

The EXTRACT syntax ends up as a call to the internal date_part(...)
function. If SQL-portability is not a concern, calling date_part()
directly should be a bit quicker.

cheers.
brent

--
"Develop your talent, man, and leave the world something. Records are
really gifts from people. To think that an artist would love you enough
to share his music with anyone is a beautiful thing." -- Duane Allman

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Gary Stainburn 2001-11-29 11:31:24 Fixing faulty dates - select on day part of a date field
Previous Message Markus Bertheau 2001-11-29 08:45:38 date_part vs extract