Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id CE7DF9FB902 for ; Mon, 19 Mar 2007 13:38:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 02923-06 for ; Mon, 19 Mar 2007 13:38:18 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 354949FB8D8 for ; Mon, 19 Mar 2007 13:38:17 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l2JGcGjD013056; Mon, 19 Mar 2007 12:38:17 -0400 (EDT) To: "Anton Pikhteryev" cc: pgsql-admin@postgresql.org Subject: Re: Problem migrating from 8.0.3 to 8.2.3 In-reply-to: References: <7901.1174062531@sss.pgh.pa.us> <9806.1174073654@sss.pgh.pa.us> Comments: In-reply-to "Anton Pikhteryev" message dated "Mon, 19 Mar 2007 09:52:27 -0400" Date: Mon, 19 Mar 2007 12:38:16 -0400 Message-ID: <13055.1174322296@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200703/119 X-Sequence-Number: 24943 "Anton Pikhteryev" writes: > I created valid_user domain on the old system (8.0.3) a long time ago > as: > CREATE DOMAIN valid_user > AS name -- pg_catalog.pg_user.usename%TYPE > DEFAULT SESSION_USER > CONSTRAINT user_exists > CHECK (has_table_privilege(VALUE,'pg_user','SELECT')); Ah. That seems a rather strange way to check that a user exists, but anyway the missing bit of information was that the domain is over type "name" which is subscriptable. You need the attached patch (which will be in 8.2.4). regards, tom lane Index: src/backend/utils/cache/lsyscache.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v retrieving revision 1.138 diff -c -r1.138 lsyscache.c *** src/backend/utils/cache/lsyscache.c 4 Oct 2006 00:30:00 -0000 1.138 --- src/backend/utils/cache/lsyscache.c 19 Mar 2007 15:56:30 -0000 *************** *** 1366,1375 **** /* * Array types get their typelem as parameter; everybody else gets their ! * own type OID as parameter. (This is a change from 8.0, in which only ! * composite types got their own OID as parameter.) */ ! if (OidIsValid(typeStruct->typelem)) return typeStruct->typelem; else return HeapTupleGetOid(typeTuple); --- 1366,1375 ---- /* * Array types get their typelem as parameter; everybody else gets their ! * own type OID as parameter. (As of 8.2, domains must get their own OID ! * even if their base type is an array.) */ ! if (typeStruct->typtype == 'b' && OidIsValid(typeStruct->typelem)) return typeStruct->typelem; else return HeapTupleGetOid(typeTuple);