Re: Problem migrating from 8.0.3 to 8.2.3

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Anton Pikhteryev" <apikhteryev(at)sandvine(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Problem migrating from 8.0.3 to 8.2.3
Date: 2007-03-19 16:38:16
Message-ID: 13055.1174322296@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Anton Pikhteryev" <apikhteryev(at)sandvine(dot)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

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);

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Gaetano Mendola 2007-03-19 17:34:25 Re: create view with check option
Previous Message Anton Pikhteryev 2007-03-19 14:24:20 Re: Problem migrating from 8.0.3 to 8.2.3