| From: | "Gaetano Mendola" <mendola(at)bigfoot(dot)com> | 
|---|---|
| To: | pgsql-admin(at)postgresql(dot)org | 
| Subject: | Re: date is not immutable ? | 
| Date: | 2003-03-12 10:38:37 | 
| Message-ID: | b4n2md$2pna$1@news.hub.org | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-admin | 
"Zachary Beane" <xach(at)xach(dot)com> wrote in message
news:slrnb6sdcb(dot)25l(dot)xach(at)localhost(dot)localdomain(dot)(dot)(dot)
> In article <b4labj$15lq$1(at)news(dot)hub(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | ApoloDNR | 2003-03-12 16:25:08 | Re: character set | 
| Previous Message | Daniel Rubio | 2003-03-12 07:21:42 | Compiling contrib utilities |