pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feeddate is not immutable ?
4+ messages / 3 participants
[nested] [flat]
* date is not immutable ?
@ 2003-03-11 18:37 Gaetano Mendola <mendola@bigfoot.com>
0 siblings, 2 replies; 4+ messages in thread
From: Gaetano Mendola @ 2003-03-11 18:37 UTC (permalink / raw)
To: pgsql-admin
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 ?
Regards
Gaetano
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: date is not immutable ?
@ 2003-03-11 19:14 Zachary Beane <xach@xach.com>
parent: Gaetano Mendola <mendola@bigfoot.com>
1 sibling, 1 reply; 4+ messages in thread
From: xach@xach.com @ 2003-03-11 19:14 UTC (permalink / raw)
To: pgsql-admin
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.
Zach
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: date is not immutable ?
@ 2003-03-12 10:38 Gaetano Mendola <mendola@bigfoot.com>
parent: Zachary Beane <xach@xach.com>
0 siblings, 0 replies; 4+ messages in thread
From: Gaetano Mendola @ 2003-03-12 10:38 UTC (permalink / raw)
To: pgsql-admin
"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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: date is not immutable ?
@ 2003-03-12 21:46 Tom Lane <tgl@sss.pgh.pa.us>
parent: Gaetano Mendola <mendola@bigfoot.com>
1 sibling, 0 replies; 4+ messages in thread
From: Tom Lane @ 2003-03-12 21:46 UTC (permalink / raw)
To: Gaetano Mendola <mendola@bigfoot.com>; +Cc: pgsql-admin
"Gaetano Mendola" <mendola@bigfoot.com> writes:
> 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 ?
Because the conversion depends on your timezone setting.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2003-03-12 21:46 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-03-11 18:37 date is not immutable ? Gaetano Mendola <mendola@bigfoot.com>
2003-03-11 19:14 ` Zachary Beane <xach@xach.com>
2003-03-12 10:38 ` Gaetano Mendola <mendola@bigfoot.com>
2003-03-12 21:46 ` Tom Lane <tgl@sss.pgh.pa.us>
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