Immutable function in index

From: SZŰCS Gábor <surrano(at)mailbox(dot)hu>
To: <pgsql-sql(at)postgresql(dot)org>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Immutable function in index
Date: 2004-07-06 08:58:47
Message-ID: 009101c46337$77f802f0$0403a8c0@fejleszt4
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-sql

Dear Gurus,

Version: PostgreSQL 7.3.3
Log:
%----------------------- cut here -----------------------%
tir=# CREATE INDEX ajanlat_cikk ON ajanlat (antinuller(cikk),
antinuller(minoseg), tol);
ERROR: parser: parse error at or near "," at character 55
tir=# CREATE INDEX ajanlat_szolg ON ajanlat (antinuller(szolgaltatas), tol);
ERROR: parser: parse error at or near "," at character 64
%----------------------- cut here -----------------------%

I'm not sure what happened, I'm quite sure it worked before, even with
7.3.3. The index was there and probably worked, but accidentally dropped it
and can't recreate.
May it be something in postgresql.conf (fumbled with it recently)?
May it be a bug in 7.3.3 (despite my memories)?

Relevant definitions:

%----------------------- cut here -----------------------%
CREATE FUNCTION antinuller (int4) RETURNS int4 AS '
SELECT CASE WHEN $1 ISNULL THEN -1 ELSE $1 END;'
LANGUAGE 'SQL' immutable;

CREATE TABLE ajanlat (
az serial NOT NULL PRIMARY KEY,
cikk integer REFERENCES cikk(az) ON UPDATE CASCADE,
minoseg integer REFERENCES minoseg(az) ON UPDATE CASCADE,
-- a minőség default 1 triggerből, mert csak ha nem szolgáltatás!
szolgaltatas integer REFERENCES szolgaltatas(az) ON UPDATE CASCADE,
tol date DEFAULT now() NOT NULL,
ig date DEFAULT '3000-01-01' NOT NULL,
CONSTRAINT kitoltes CHECK
((cikk ISNULL = minoseg ISNULL) AND (cikk ISNULL = szolgaltatas
NOTNULL))
);

CREATE INDEX ajanlat_cikk ON ajanlat (antinuller(cikk), antinuller(minoseg),
tol);
CREATE INDEX ajanlat_szolg ON ajanlat (antinuller(szolgaltatas), tol);
%----------------------- cut here -----------------------%

TIA,
G.
%----------------------- cut here -----------------------%
\end

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Newall 2004-07-06 09:26:31 Can't join on null values
Previous Message Luis Sousa 2004-07-06 08:33:17 Bug related with permissions - VIEWS and RULES

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2004-07-06 13:37:59 Re: [SQL] Immutable function in index
Previous Message Peter Eisentraut 2004-07-05 19:39:40 Re: Custom type where not all elements are comparable