-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I was trying to create a functional index on a timestamptz column and had the following problem. It seems subraction of an interval from a timestamptz is not immutable. Should this be the case?

foo=> create table timestamp_tz_test ( start timestamptz primary key );
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "timestamp_tz_test_pkey" for table "timestamp_tz_test"
CREATE TABLE
 
foo=> create INDEX idx_timestamptz_rtree on timestamp_tz_test using 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 error:


foo=> create table timestamp_test ( start timestamp primary key );
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "timestamp_test_pkey" for table "timestamp_test"
CREATE TABLE
 
foo=> create INDEX idx_timestamp_rtree on timestamp_test using rtree ((start - '15 minutes'::INTERVAL));
ERROR: data type timestamp without time zone has no default operator class for access method "rtree"
HINT: You must specify an operator class for the index or define a 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=
=ayoM
-----END PGP SIGNATURE-----


---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply via email to