Thread: 8.2.2 regression with indices on user functions, 8.2.1 works

8.2.2 regression with indices on user functions, 8.2.1 works

From
Tomas Szepe
Date:
Hi,

Upgraded to 8.2.2 last night and had to revert to 8.2.1
first thing in the morning after hitting this problem:

A trivial update like
    update mwdev set nick='Bezno-V-360';
fails with
    ERROR:  attribute 1 has wrong type
    DETAIL:  Table has type character varying, but query expects character varying.

There are no further messages in server.log.

A minimal testcase to replicate the problem follows:

$ createdb -E UNICODE testdb
CREATE DATABASE
$ (cat| psql testdb) << EOF
CREATE FUNCTION e_tolower(text) RETURNS text
    AS \$_\$select translate(\$1, 'Q', 'q');\$_\$
    LANGUAGE sql IMMUTABLE;
CREATE TABLE testtbl (foo character varying(16) NOT NULL);
COPY testtbl (foo) FROM stdin;
whatever
\.
CREATE UNIQUE INDEX testtbl_testidx ON testtbl
    USING btree (e_tolower((foo)::text));
UPDATE testtbl SET foo='whatever2';
EOF
CREATE FUNCTION
CREATE TABLE
CREATE INDEX
ERROR:  attribute 1 has wrong type
DETAIL:  Table has type character varying, but query expects character varying.
$

Just putting back the old 8.2.1 binaries is enough
(the problem disappears), no need to redump/reinitdb.

System: Linux 2.6.20, x86, glibc 2.5, gcc 4.1.1.

Hope this helps,
--
Tomas Szepe <szepe@pinerecords.com>

Re: 8.2.2 regression with indices on user functions, 8.2.1 works

From
Tom Lane
Date:
Tomas Szepe <szepe@pinerecords.com> writes:
> Upgraded to 8.2.2 last night and had to revert to 8.2.1
> first thing in the morning after hitting this problem:

Can you try your production case (not just a minimal example) with this
patch?
http://archives.postgresql.org/pgsql-committers/2007-02/msg00128.php

            regards, tom lane

Re: 8.2.2 regression with indices on user functions, 8.2.1 works

From
Tomas Szepe
Date:
> > Upgraded to 8.2.2 last night and had to revert to 8.2.1
> > first thing in the morning after hitting this problem:
>
> Can you try your production case (not just a minimal example) with this
> patch?
> http://archives.postgresql.org/pgsql-committers/2007-02/msg00128.php

The patch didn't apply on top of vanilla 8.2.2, so I fetched the
current 8.2 CVS head - seems to work fine with our production db.

Thanks!

--
Tomas Szepe <szepe@pinerecords.com>