Re: [PATCH] Largeobject access controls

From: KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>, KaiGai Kohei <kaigai(at)kaigai(dot)gr(dot)jp>, Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Largeobject access controls
Date: 2009-10-07 01:11:32
Message-ID: 4ACBEAC4.3000006@ak.jp.nec.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> KaiGai Kohei <kaigai(at)ak(dot)jp(dot)nec(dot)com> writes:
>> I rebased the largeobject access controls patch to the CVS HEAD
>> because of the patch confliction to the default ACL patch.
>
> Quick comment on this --- I think that using a syscache for large
> objects is probably not a good idea. There is no provision in the
> catcache code for limiting the cache size anymore, and that means that
> anybody who touches a large number of large objects is going to blow out
> memory. We removed the old cache limit code because that seemed most
> sensible for the use of the caches for regular catalog objects, but
> I don't think LOs will have the same characteristics with respect to
> either number of objects or locality of access.

The attached patch is the revised largeobject access controls.

It replaced any usage of system cache for pg_largeobject_metadata.
In this patch, we basically follow the manner in the pg_tablespace
which also does not have its own system cache.
For example, it needs to open the pg_largeobject_metadata relation
with AccessShareLock when pg_largeobject_aclcheck() is called, as
pg_tablespace_aclcheck() doing.

$ diffstat sepgsql-02-blob-8.5devel-r2354.patch.gz
doc/src/sgml/config.sgml | 28 +
doc/src/sgml/ref/allfiles.sgml | 1
doc/src/sgml/ref/alter_large_object.sgml | 75 ++++
doc/src/sgml/ref/grant.sgml | 8
doc/src/sgml/ref/revoke.sgml | 6
doc/src/sgml/reference.sgml | 1
src/backend/catalog/Makefile | 6
src/backend/catalog/aclchk.c | 294 ++++++++++++++++++
src/backend/catalog/dependency.c | 14
src/backend/catalog/pg_largeobject.c | 406 +++++++++++++++++!!!!!!!!
src/backend/catalog/pg_shdepend.c | 5
src/backend/commands/alter.c | 5
src/backend/commands/comment.c | 7
src/backend/commands/tablecmds.c | 1
src/backend/libpq/be-fsstubs.c | 49 +-
src/backend/parser/gram.y | 20 +
src/backend/storage/large_object/inv_api.c | 108 +---!
src/backend/tcop/utility.c | 3
src/backend/utils/adt/acl.c | 5
src/backend/utils/misc/guc.c | 10
src/backend/utils/misc/postgresql.conf.sample | 1
src/bin/psql/large_obj.c | 10
src/include/catalog/dependency.h | 1
src/include/catalog/indexing.h | 3
src/include/catalog/pg_largeobject.h | 4
src/include/catalog/pg_largeobject_metadata.h | 68 ++++
src/include/nodes/parsenodes.h | 1
src/include/utils/acl.h | 6
src/test/regress/expected/privileges.out | 206 +++++++++++++
src/test/regress/expected/sanity_check.out | 3
src/test/regress/sql/privileges.sql | 84 +++++
31 files changed, 1166 insertions(+), 80 deletions(-), 193 modifications(!)

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

Attachment Content-Type Size
sepgsql-02-blob-8.5devel-r2354.patch.gz application/gzip 16.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2009-10-07 01:36:33 Re: Streaming Replication patch for CommitFest 2009-09
Previous Message Jeff Janes 2009-10-07 00:29:48 Re: Making hash indexes worthwhile