X-Original-To: pgsql-admin@postgresql.org Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 0F72F476353 for ; Wed, 12 Mar 2003 05:38:06 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id EDA2443A611; Wed, 12 Mar 2003 05:38:05 -0500 (EST) From: "Gaetano Mendola" X-Newsgroups: comp.databases.postgresql.admin Subject: Re: date is not immutable ? Date: Wed, 12 Mar 2003 11:38:37 +0100 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 27 Message-ID: References: Reply-To: "Gaetano Mendola" X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 To: pgsql-admin@postgresql.org X-Archive-Number: 200303/138 X-Sequence-Number: 7778 "Zachary Beane" wrote in message news:slrnb6sdcb.25l.xach@localhost.localdomain... > In article , 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