problem creating rtree index on timestamptz
| От | Hussein Patni | 
|---|---|
| Тема | problem creating rtree index on timestamptz | 
| Дата | |
| Msg-id | a4418a0a181921ecea6c4e5fda6f46d8@cosbit.com обсуждение исходный текст | 
| Ответы | Re: problem creating rtree index on timestamptz | 
| Список | pgsql-bugs | 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,
    I was trying to create a functional index on a timestamptz column and=20
had the following problem. It seems subraction of an interval from a=20
timestamptz is not immutable. Should this be the case?
foo=3D> create table timestamp_tz_test ( start timestamptz primary key );
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index=20
"timestamp_tz_test_pkey" for table "timestamp_tz_test"
CREATE TABLE
=A0
foo=3D> create INDEX idx_timestamptz_rtree on timestamp_tz_test using=20
rtree ((start - '15 minutes'::INTERVAL));
ERROR:  functions in index expression must be marked IMMUTABLE
    I then tried a similar task with just at timestamp column and got this=20
error:
foo=3D> create table timestamp_test ( start timestamp primary key );
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index=20
"timestamp_test_pkey" for table "timestamp_test"
CREATE TABLE
=A0
foo=3D> create INDEX idx_timestamp_rtree on timestamp_test using rtree=20
((start - '15 minutes'::INTERVAL));
ERROR:  data type timestamp without time zone has no default operator=20
class for access method "rtree"
HINT:  You must specify an operator class for the index or define a=20
default operator class for the data type.
Should there be a default for this?
Thanks in advance,
- --hussein
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
iD8DBQFCI44ZI2IgiXMhqe4RAnHvAKC9o2xHmfdQ0MuYJ8XWK3v9uxf5IgCgnCuk
tD2jJUIWaGlPtbiBcByE1HU=3D
=3DayoM
-----END PGP SIGNATURE-----
		
	В списке pgsql-bugs по дате отправления: