pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Brent Verner <brent@rcfile.org>
To: Markus Bertheau <twanger@bluetwanger.de>
Cc: postgres sql list <pgsql-sql@postgresql.org>
Subject: Re: date_part vs extract
Date: Thu, 29 Nov 2001 04:48:39 -0500
Message-ID: <20011129094839.GB11369@rcfile.org> (raw)
In-Reply-To: <1007023539.4636.66.camel@entwicklung01.cenes.de>
References: <1007023539.4636.66.camel@entwicklung01.cenes.de>

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



view thread (4+ messages)  latest in thread

Message-ID: <20011129094839.GB11369@rcfile.org>
Permalink:  ../20011129094839.GB11369@rcfile.org/
Also on:    postgresql.org/message-id/20011129094839.GB11369@rcfile.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: brent@rcfile.org, twanger@bluetwanger.de
  Subject: Re: date_part vs extract
  In-Reply-To: <20011129094839.GB11369@rcfile.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox