|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/lobj.sgml,v 1.50 2009/12/11 03:34:55 itagaki Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/lobj.sgml,v 1.51 2009/12/17 14:36:16 rhaas Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter id="largeObjects">
|
4 | 4 | <title id="largeObjects-title">Large Objects</title>
|
|
59 | 59 | searches for the correct chunk number when doing random
|
60 | 60 | access reads and writes.
|
61 | 61 | </para>
|
| 62 | + |
| 63 | + <para> |
| 64 | + As of <productname>PostgreSQL</> 8.5, large objects have an owner |
| 65 | + and a set of access permissions, which can be managed using |
| 66 | + <xref linkend="sql-grant" endterm="sql-grant-title"> and |
| 67 | + <xref linkend="sql-revoke" endterm="sql-revoke-title">. |
| 68 | + For compatibility with prior releases, see |
| 69 | + <xref linkend="guc-lo-compat-privileges">. |
| 70 | + <literal>SELECT</literal> privileges are required to read a large |
| 71 | + object, and |
| 72 | + <literal>UPDATE</literal> privileges are required to write to or |
| 73 | + truncate it. |
| 74 | + Only the large object owner (or the database superuser) can unlink, comment |
| 75 | + on, or change the owner of a large object. |
| 76 | + </para> |
62 | 77 | </sect1>
|
63 | 78 |
|
64 | 79 | <sect1 id="lo-interfaces">
|
@@ -438,60 +453,9 @@ SELECT lo_export(image.raster, '/tmp/motd') FROM image
|
438 | 453 | owning user. Therefore, their use is restricted to superusers. In
|
439 | 454 | contrast, the client-side import and export functions read and write files
|
440 | 455 | in the client's file system, using the permissions of the client program.
|
441 |
| - The client-side functions can be used by any |
442 |
| - <productname>PostgreSQL</productname> user. |
| 456 | + The client-side functions do not require superuser privilege. |
443 | 457 | </para>
|
444 | 458 |
|
445 |
| - <sect2 id="lo-func-privilege"> |
446 |
| - <title>Large object and privileges</title> |
447 |
| - <para> |
448 |
| - Note that access control feature was not supported in the 8.4.x series |
449 |
| - and earlier release. |
450 |
| - Also see the <xref linkend="guc-lo-compat-privileges"> compatibility |
451 |
| - option. |
452 |
| - </para> |
453 |
| - <para> |
454 |
| - Now it supports access controls on large objects, and allows the owner |
455 |
| - of large objects to set up access rights using |
456 |
| - <xref linkend="sql-grant" endterm="sql-grant-title"> and |
457 |
| - <xref linkend="sql-revoke" endterm="sql-revoke-title"> statement. |
458 |
| - </para> |
459 |
| - <para> |
460 |
| - Two permissions are defined on the large object class. |
461 |
| - These are checked only when <xref linkend="guc-lo-compat-privileges"> |
462 |
| - option is disabled. |
463 |
| - </para> |
464 |
| - <para> |
465 |
| - The first is <literal>SELECT</literal>. |
466 |
| - It is required on <function>loread()</function> function. |
467 |
| - Note that when we open large object with read-only mode, we can see |
468 |
| - a static image even if other concurrent transaction modified the |
469 |
| - same large object. |
470 |
| - This principle is also applied on the access rights of large objects. |
471 |
| - Even if a transaction modified access rights and commit it, it is |
472 |
| - not invisible from other transaction which already opened the large |
473 |
| - object. |
474 |
| - </para> |
475 |
| - <para> |
476 |
| - The second is <literal>UPDATE</literal>. |
477 |
| - It is required on <function>lowrite()</function> function and |
478 |
| - <function>lo_truncate()</function> function. |
479 |
| - </para> |
480 |
| - <para> |
481 |
| - In addition, <function>lo_unlink()</function> function, |
482 |
| - <command>COMMENT ON</command> and <command>ALTER LARGE OBJECT</command> |
483 |
| - statements needs ownership of the large object to be accessed. |
484 |
| - </para> |
485 |
| - <para> |
486 |
| - You may wonder why <literal>SELECT</literal> is not checked on the |
487 |
| - <function>lo_export()</function> function or <literal>UPDATE</literal> |
488 |
| - is not checked on the <function>lo_import</function> function. |
489 |
| - |
490 |
| - These functions originally require database superuser privilege, |
491 |
| - and it allows to bypass the default database privilege checks, |
492 |
| - so we don't need to check an obvious test twice. |
493 |
| - </para> |
494 |
| - </sect2> |
495 | 459 | </sect1>
|
496 | 460 |
|
497 | 461 | <sect1 id="lo-examplesect">
|
|
0 commit comments