Skip site navigation (1) Skip section navigation (2)

Re: Largeobject Access Controls (r2460)

From: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
To: Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>, Greg Smith <greg(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Largeobject Access Controls (r2460)
Date: 2010-01-21 08:31:14
Message-ID: 4B5810D2.1040900@ak.jp.nec.com (view raw or flat)
Thread:
Lists: pgsql-hackers
(2010/01/21 16:52), Takahiro Itagaki wrote:
> 
> KaiGai Kohei<kaigai(at)ak(dot)jp(dot)nec(dot)com>  wrote:
> 
>> This patch renamed the hasBlobs() by getBlobs(), and changed its
>> purpose. It registers DO_BLOBS, DO_BLOB_COMMENTS and DO_BLOB_ACLS
>> for each large objects owners, if necessary.
> 
> This patch adds DumpableObjectType DO_BLOB_ACLS and struct BlobsInfo. We
> use three BlobsInfo objects for DO_BLOBS, DO_BLOB_COMMENTS, and DO_BLOB_ACLS
> _for each distinct owners_ of large objects. So, even if we have many large
> objects in the database, we just keep at most (3 * num-of-roles) BlobsInfo
> in memory. For older versions of server, we assume that blobs are owned by
> only one user with an empty name. We have no BlobsInfo if no large objects.
> 
> 
> I'm not sure whether we need to make groups for each owner of large objects.
> If I remember right, the primary issue was separating routines for dump
> BLOB ACLS from routines for BLOB COMMENTS, right? Why did you make the change?

When --use-set-session-authorization is specified, pg_restore tries to
change database role of the current session just before creation of
database objects to be restored.

Ownership of the database objects are recorded in the section header,
and it informs pg_restore who should be owner of the objects to be
restored in this section.

Then, pg_restore can generate ALTER xxx OWNER TO after creation, or
SET SESSION AUTHORIZATION before creation in runtime.
So, we cannot put creation of largeobjects with different ownership
in same section.

It is the reason why we have to group largeobjects by database user.

> Another concern is their confusable identifier names -- getBlobs()
> returns BlobsInfo for each owners. Could we rename them something
> like getBlobOwners() and BlobOwnerInfo?

OK, I'll do.

> Also, DumpableObject.name is not used in BlobsInfo. We could reuse
> DumpableObject.name instead of the "rolname" field in BlobsInfo.

Isn't it confusable for the future hacks?
It follows the manner in other database object classes.

Thanks,
-- 
OSS Platform Development Division, NEC
KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>

In response to

Responses

pgsql-hackers by date

Next:From: Takahiro ItagakiDate: 2010-01-21 08:34:20
Subject: Re: About "Our CLUSTER implementation is pessimal" patch
Previous:From: Leonardo FDate: 2010-01-21 08:18:01
Subject: Re: About "Our CLUSTER implementation is pessimal" patch

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group