pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Immutable function in index
2+ messages / 2 participants
[nested] [flat]

* Immutable function in index
@ 2004-07-06 08:58 SZŰCS Gábor <surrano@mailbox.hu>
  2004-07-06 13:37 ` Re: [SQL] Immutable function in index Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: SZŰCS Gábor @ 2004-07-06 08:58 UTC (permalink / raw)
  To: pgsql-sql; pgsql-bugs@postgresql.org

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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [SQL] Immutable function in index
  2004-07-06 08:58 Immutable function in index SZŰCS Gábor <surrano@mailbox.hu>
@ 2004-07-06 13:37 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2004-07-06 13:37 UTC (permalink / raw)
  To: SZŰCS Gábor <surrano@mailbox.hu>; +Cc: pgsql-sql; pgsql-bugs@postgresql.org

"=?iso-8859-2?B?U1rbQ1MgR+Fib3I=?=" <surrano@mailbox.hu> writes:
> tir=# CREATE INDEX ajanlat_cikk ON ajanlat (antinuller(cikk),
> antinuller(minoseg), tol);
> ERROR:  parser: parse error at or near "," at character 55

> I'm not sure what happened,

You're trying to use a 7.4 feature in 7.3.  Multiple functional columns
in one index is new in 7.4.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-07-06 13:37 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-07-06 08:58 Immutable function in index SZŰCS Gábor <surrano@mailbox.hu>
2004-07-06 13:37 ` Tom Lane <tgl@sss.pgh.pa.us>

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