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: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, 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: 2009-12-21 00:39:38
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
(2009/12/19 12:05), Robert Haas wrote:
> On Fri, Dec 18, 2009 at 9:48 PM, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us>  wrote:
>> Robert Haas<robertmhaas(at)gmail(dot)com>  writes:
>>> Oh.  This is more complicated than it appeared on the surface.  It
>>> seems that the string "BLOB COMMENTS" actually gets inserted into
>>> custom dumps somewhere, so I'm not sure whether we can just change it.
>>>   Was this issue discussed at some point before this was committed?
>>> Changing it would seem to require inserting some backward
>>> compatibility code here.  Another option would be to add a separate
>>> section for "BLOB METADATA", and leave "BLOB COMMENTS" alone.  Can
>>> anyone comment on what the Right Thing To Do is here?
>> The BLOB COMMENTS label is, or was, correct for what it contained.
>> If this patch has usurped it to contain other things
> It has.
>> I would argue
>> that that is seriously wrong.  pg_dump already has a clear notion
>> of how to handle ACLs for objects.  ACLs for blobs ought to be
>> made to fit into that structure, not dumped in some random place
>> because that saved a few lines of code.
> OK.  Hopefully KaiGai or Takahiro can suggest a fix.

Currently, BLOBS (and BLOB COMMENTS) section does not contain
owner of the large objects, because it may press the local memory
of pg_dump when the database contains massive amount of large
I believe it is the reason why we dump all the large objects in
a single section. Correct?

I don't think it is reasonable to dump all the large object with
its individual section.
However, we can categorize them per owner. In generally, we can
assume the number of database users are smaller than the number
of large objects.
In other word, we can obtain the number of sections to be dumped
as result of the following query:

  SELECT DISTINCT lomowner FROM pg_largeobject_metadata;

Then, we can dump them per users.

For earlier versions, all the large objects will be dumped in
a single section with anonymous user.

What's your opinion?
OSS Platform Development Division, NEC
KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>

In response to


pgsql-hackers by date

Next:From: Robert HaasDate: 2009-12-21 01:23:39
Subject: Re: Patch: Remove all declarations from pg_attribute.h, consolidate BKI scripts
Previous:From: John NaylorDate: 2009-12-21 00:20:53
Subject: Patch: Remove all declarations from pg_attribute.h, consolidate BKI scripts

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