Re: [PATCH] Largeobject access controls - Mailing list pgsql-hackers

From KaiGai Kohei
Subject Re: [PATCH] Largeobject access controls
Date
Msg-id 4ACBEAC4.3000006@ak.jp.nec.com
Whole thread Raw
In response to Re: [PATCH] Largeobject access controls  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCH] Largeobject access controls
List pgsql-hackers
Tom Lane wrote:
> KaiGai Kohei <kaigai@ak.jp.nec.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@ak.jp.nec.com>

Attachment

pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: Making hash indexes worthwhile
Next
From: Fujii Masao
Date:
Subject: Re: Streaming Replication patch for CommitFest 2009-09