From: | Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | daniel(at)digsys(dot)bg (Daniel Kalchev) |
Cc: | pgsql-hackers(at)hub(dot)org |
Subject: | Re: [HACKERS] functional indexes |
Date: | 1998-10-02 06:16:08 |
Message-ID: | 199810020616.CAA28813@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Added to open 6.4 bugs list.
> With the current snapshot, there seems to be problem with functional indexes.
> Example:
>
> CREATE TABLE timelog (loginname text, site varchar(16), start_time datetime,
> elapsed timespan);
> CREATE FUNCTION datetime_day (datetime ) RETURNS float8 AS 'select
> date_part(''day'', $1)' LANGUAGE 'SQL';
> INSERT INTO timelog values ('abc','varna','Thu 01 Jan 23:23:34 1998 EET','@ 10
> mins');
> INSERT INTO timelog values ('abc','sofia','Thu 01 Jan 23:23:34 1998 EET','@ 2
> hours 10 mins');
>
> $ psql test
> Welcome to the POSTGRESQL interactive sql monitor:
> Please read the file COPYRIGHT for copyright terms of POSTGRESQL
>
> type \? for help on slash commands
> type \q to quit
> type \g or terminate with semicolon to execute query
> You are currently connected to the database: test
>
> test=> create index timelog_date_idx on timelog (datetime_day(start_time));
> ERROR: DefineIndex: (null) class not found
> test=>
>
> Also, using date_part() directly in the index definition:
>
> test=> create index timelog_date_idx on timelog (datetime_part('day',
> start_time));
> ERROR: parser: parse error at or near "'"
>
>
> Can something be done about this before 6.4 is released?
>
> Daniel
>
>
>
>
--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 1998-10-02 06:18:30 | Open 6.4 items |
Previous Message | Tom Lane | 1998-10-02 06:14:22 | Re: [HACKERS] delete from ..;vacuum crashes |