pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: SZŰCS Gábor <surrano@mailbox.hu>
To: pgsql-sql@postgresql.org
To: pgsql-bugs@postgresql.org
Subject: Immutable function in index
Date: Tue, 6 Jul 2004 10:58:47 +0200
Message-ID: <009101c46337$77f802f0$0403a8c0@fejleszt4> (raw)

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




view thread (2+ messages)  latest in thread

Message-ID: <009101c46337$77f802f0$0403a8c0@fejleszt4>
Permalink:  ../009101c46337$77f802f0$0403a8c0@fejleszt4/
Also on:    postgresql.org/message-id/009101c46337$77f802f0$0403a8c0@fejleszt4

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: surrano@mailbox.hu, pgsql-bugs@postgresql.org
  Subject: Re: Immutable function in index
  In-Reply-To: <009101c46337$77f802f0$0403a8c0@fejleszt4>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox