pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gaetano Mendola <mendola@bigfoot.com>
To: pgsql-admin@postgresql.org
Subject: Re: date is not immutable ?
Date: Wed, 12 Mar 2003 11:38:37 +0100
Message-ID: <b4n2md$2pna$1@news.hub.org> (raw)
References: <b4labj$15lq$1@news.hub.org>
	<slrnb6sdcb.25l.xach@localhost.localdomain>

"Zachary Beane" <xach@xach.com> wrote in message
news:slrnb6sdcb.25l.xach@localhost.localdomain...
> In article <b4labj$15lq$1@news.hub.org>, Gaetano Mendola wrote:
> > Hi all,
> > I'm trying to create an index on a timestamptz field just extracting the
> > date:
> >
> > # create index idx_user_logs_login_time_date on user_logs (
> > date(login_time) );
> > ERROR:  DefineIndex: index function must be marked IMMUTABLE
> >
> >
> > why date is not marked immutable ?
>
> It is influenced by the local time zone.

Do you know another way to improve the select:

SELECT * FROM T WHERE date(login_time) = now()::date;


Regards
Gaetano







view thread (4+ messages)  latest in thread

Message-ID: <b4n2md$2pna$1@news.hub.org>
Permalink:  ../b4n2md$2pna$1@news.hub.org/
Also on:    postgresql.org/message-id/b4n2md$2pna$1@news.hub.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: mendola@bigfoot.com
  Subject: Re: date is not immutable ?
  In-Reply-To: <b4n2md$2pna$1@news.hub.org>
  References: <b4labj$15lq$1@news.hub.org> <slrnb6sdcb.25l.xach@localhost.localdomain> <b4n2md$2pna$1@news.hub.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