Re: [GENERAL] [8.1.4] Create index on timestamp fails

2006-08-23 Thread Karsten Hilbert
On Wed, Aug 23, 2006 at 09:42:00AM -0400, Tom Lane wrote: > It sounds a bit bogus to me too. Another possibility is to keep the > data storage as timestamptz (which is really the recommended type for > any sort of real time values), and define the index on > > date_part('day', entry_time A

Re: [GENERAL] [8.1.4] Create index on timestamp fails

2006-08-23 Thread Tom Lane
Karsten Hilbert <[EMAIL PROTECTED]> writes: > On Wed, Aug 23, 2006 at 09:07:35AM -0400, Alvaro Herrera wrote: >> Another idea would be to separate the date column (which would have the >> index) from the time column (which would have the timezone). The >> timezone is important -- if you have "blog

Re: [GENERAL] [8.1.4] Create index on timestamp fails

2006-08-23 Thread Karsten Hilbert
On Wed, Aug 23, 2006 at 09:07:35AM -0400, Alvaro Herrera wrote: > Another idea would be to separate the date column (which would have the > index) from the time column (which would have the timezone). The > timezone is important -- if you have "bloggers" from all around the > world you're gonna h

Re: [GENERAL] [8.1.4] Create index on timestamp fails

2006-08-23 Thread Alvaro Herrera
Arturo Perez wrote: > > On Aug 22, 2006, at 5:35 PM, Tom Lane wrote: > >I seriously doubt that. date_part on a timestamptz is stable, not > >immutable, and AFAICT has been marked that way since 7.3. The problem > >is that the results depend on your current TimeZone setting --- for > >instance,

Re: [GENERAL] [8.1.4] Create index on timestamp fails

2006-08-23 Thread Arturo Perez
Hi Chris,   user_tracking is not a function, it's the name of the table containing the column entry_date.  Is my syntax that far off?!   -arturo -Original Message-From: Chris Hoover [mailto:[EMAIL PROTECTED]Sent: Tuesday, August 22, 2006 3:02 PMTo: Arturo PerezCc: pgsql-gen

Re: [GENERAL] [8.1.4] Create index on timestamp fails

2006-08-23 Thread Arturo Perez
On Aug 22, 2006, at 5:35 PM, Tom Lane wrote: "Arturo Perez" <[EMAIL PROTECTED]> writes: I have a table with an column: entry_date | timestamp with time zone| not null And when I try to create an index on it like so: create index entry_date_idx on = user_tracking(date_part('y

Re: [GENERAL] [8.1.4] Create index on timestamp fails

2006-08-22 Thread Tom Lane
"Arturo Perez" <[EMAIL PROTECTED]> writes: > I have a table with an column: > entry_date | timestamp with time zone| not null > And when I try to create an index on it like so: > create index entry_date_idx on = > user_tracking(date_part('year',entry_date)); > I get a > ERROR: f

Re: [GENERAL] [8.1.4] Create index on timestamp fails

2006-08-22 Thread Chris Hoover
It appears that 8.1 is stricter on checking the type of function.  Look at your user_tracking function.  It is probably set as volatile.  You need to change it to be immutable.This should fix the issue.Chris On 8/21/06, Arturo Perez <[EMAIL PROTECTED]> wrote: Hi all, Using postgresql 8.

[GENERAL] [8.1.4] Create index on timestamp fails

2006-08-22 Thread Arturo Perez
Title: [8.1.4] Create index on timestamp fails Hi all, Using postgresql 8.1.4 I have a table with an column:     entry_date | timestamp with time zone| not null And when I try to create an index on it like so:     create index entry_date_idx on user_tracking(date_part('yea