Re: How about to have relnamespace and relrole?

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: Jim(dot)Nasby(at)BlueTreble(dot)com
Cc: andres(at)2ndquadrant(dot)com, robertmhaas(at)gmail(dot)com, tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)postgresql(dot)org
Subject: Re: How about to have relnamespace and relrole?
Date: 2015-03-04 02:04:57
Message-ID: 20150304.110457.100314357.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello, I attached the latest patches missing in the previous mail.

Thanks for pointing Jeevan.

0001-Add-regrole_v4.patch
0002-Add-regnamespace_v4.patch

Jim> BTW, I think the potential for MVCC issues should be mentioned in the
Jim> docs (http://www.postgresql.org/docs/devel/static/datatype-oid.html).

The first patch of the aboves contains doc patch which adds the
following note to html/datatype-oid.html. Does it make sense?

> Note: The OID alias types don't sctrictly comply the transaction
> isolation rules so do not use them where exact transaction
> isolation on the values of these types has a
> significance. Likewise, since they look as simple constants to
> planner so you might get slower plans than the queries joining
> the system tables correnspond to the OID types.

regards,

At Mon, 2 Mar 2015 17:50:37 -0600, Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com> wrote in <54F4F74D(dot)8000003(at)BlueTreble(dot)com>
> On 3/2/15 3:56 PM, Andres Freund wrote:
> > On 2015-03-02 16:42:35 -0500, Robert Haas wrote:
> >> >On Tue, Feb 3, 2015 at 10:12 AM, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >>> > >Two reasons this isn't terribly compelling are (1) it's creating a
> >>> > >join in a place where the planner can't possibly see it and optimize
> >>> > >it, and (2) you risk MVCC anomalies because the reg* output routines
> >>> > >would not be using the same snapshot as the calling query.
> >>> > >
> >>> > >We already have problem (2) with the existing reg* functions so I'm
> >>> > >not that excited about doubling down on the concept.
> >> >
> >> >I think I agree. I mean, I agree that this notation is more
> >> >convenient, but I don't really want to add a whole new slough of types
> >> >--- these will certainly not be the only ones we want once we go down
> >> >this path --- to the default install just for notational convenience.
> >> >It's arguable, of course, but I guess I'm going to vote against this
> >> >patch.
> > That's a justifyable position. I don't think there are other catalogs
> > referenced as pervasively in the catalog though.
> >
> > There's one additional point: Using reg* types in the catalog tables
> > themselves can make them*much* easier to read. I personally do look at
> > the catalogs a awful lot, and seing names instead of oids makes it
> > much
> > easier. And adding regtype/role would allow to cover nearly all types
> > containing oids.
>
> +1. Constantly joining catalog tables together is a royal PITA, and
> regnamespace is the biggest missing part of this (I typically don't
> look at roles too much, but I can certainly see it's importance).
>
> If we had more user friendly views on the catalogs maybe this wouldn't
> be an issue... but that's a much larger project.
>
> BTW, I think the potential for MVCC issues should be mentioned in the
> docs (http://www.postgresql.org/docs/devel/static/datatype-oid.html).

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
0001-Add-regrole_v4.patch text/x-patch 19.4 KB
0002-Add-regnamespace_v4.patch text/x-patch 15.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2015-03-04 02:11:07 Re: MD5 authentication needs help
Previous Message Bruce Momjian 2015-03-04 02:01:46 MD5 authentication needs help