Thread: BUG #2979: Functional indexes ERROR while updating table

BUG #2979: Functional indexes ERROR while updating table

From
"Roman Grigorovich"
Date:
The following bug has been logged online:

Bug reference:      2979
Logged by:          Roman Grigorovich
Email address:      mail@atz.msk.ru
PostgreSQL version: 8.1.7
Operating system:   FreeBSD 5.4-RELEASE
Description:        Functional indexes ERROR while updating table
Details:

create table test1 (name varchar(64));
create index test1_name_idx on test1(upper(name));
insert into test1 values ('test');
update test1 set name = 'test1';

ERROR:  attribute 1 has wrong type
DETAIL:  Table has type character varying, but query expects character
varying.

What is it? On version 8.1.2 - ALL OK!

Detail of config:
bash-3.00# ./pg_config
BINDIR = /usr/local/postgres/bin
DOCDIR =
INCLUDEDIR = /usr/local/postgres/include
PKGINCLUDEDIR = /usr/local/postgres/include
INCLUDEDIR-SERVER = /usr/local/postgres/include/server
LIBDIR = /usr/local/postgres/lib
PKGLIBDIR = /usr/local/postgres/lib
LOCALEDIR = /usr/local/postgres/share/locale
MANDIR = /usr/local/postgres/man
SHAREDIR = /usr/local/postgres/share
SYSCONFDIR = /usr/local/postgres/etc
PGXS = /usr/local/postgres/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--prefix=/usr/local/postgres' '--without-docdir' '--enable-nls'
'--cache-file=/dev/null' 'CPPFLAGS=-I/usr/local/include'
'LDFLAGS=-L/usr/local/lib'
CC = gcc
CPPFLAGS = -I/usr/local/include
CFLAGS = -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
CFLAGS_SL = -fPIC -DPIC
LDFLAGS = -L/usr/local/lib -Wl,-R/usr/local/postgres/lib
LDFLAGS_SL =
LIBS = -lpgport -lintl -lz -lreadline -lcrypt -lcompat -lm -lutil
VERSION = PostgreSQL 8.1.7

Cluster info:
LC_COLLATE: ru_RU.UTF-8
LC_CTYPE: ru_RU.UTF-8

Re: BUG #2979: Functional indexes ERROR while updating table

From
"Guillaume Smet"
Date:
Roman,

On 2/7/07, Roman Grigorovich <mail@atz.msk.ru> wrote:
> ERROR:  attribute 1 has wrong type
> DETAIL:  Table has type character varying, but query expects character
> varying.
>
> What is it? On version 8.1.2 - ALL OK!

This is a known problem of 8.1.7. That's why 8.1.8 has been released.

So you should upgrade to 8.1.8 to fix your problem.

--
Guillaume