From: Tom Lane <tgl@sss.pgh.pa.us>
To: Anton Pikhteryev <apikhteryev@sandvine.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Problem migrating from 8.0.3 to 8.2.3
Date: Mon, 19 Mar 2007 12:38:16 -0400
Message-ID: <13055.1174322296@sss.pgh.pa.us> (raw)
In-Reply-To: <F489AB573A749146B33461ECE080913A0108BEF9@EXCHANGE-1.sandvine.com>
References: <F489AB573A749146B33461ECE080913A0108BEF4@EXCHANGE-1.sandvine.com>
<7901.1174062531@sss.pgh.pa.us>
<F489AB573A749146B33461ECE080913A0108BEF5@EXCHANGE-1.sandvine.com>
<9806.1174073654@sss.pgh.pa.us>
<F489AB573A749146B33461ECE080913A0108BEF9@EXCHANGE-1.sandvine.com>
"Anton Pikhteryev" <apikhteryev@sandvine.com> 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
inline patch 1: src/backend/utils/cache/lsyscache.c (+3/-3 lines) download inline-1.patchIndex: 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);
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, apikhteryev@sandvine.com
Subject: Re: Problem migrating from 8.0.3 to 8.2.3
In-Reply-To: <13055.1174322296@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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