Re: vacuumlo fails in the presence of a index on expression - demo sql included

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: vacuumlo fails in the presence of a index on expression - demo sql included
Date: 2004-08-19 21:10:08
Message-ID: 12432.1092949808@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Frank van Vugt <ftm(dot)van(dot)vugt(at)foxi(dot)nl> writes:
> CREATE FUNCTION get_level(varchar) RETURNS int LANGUAGE 'sql' IMMUTABLE STRICT
> SECURITY INVOKER AS 'SELECT id FROM level WHERE abbreviation = $1';

The bug is in this function: it's assuming that "level" will always be
in the current search path. Perhaps you want "FROM public.level".

Frankly, since this function is clearly *not* immutable, almost any
misbehavior of an index depending on it is going to be considered
not-a-bug...

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2004-08-20 00:11:36 Re:
Previous Message Kendrick C. Wilson 2004-08-19 20:02:06