codekingpro/portable-devtools
115k
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>35.2. Implementation Features</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="lo-intro.html" title="35.1. Introduction" /><link rel="next" href="lo-interfaces.html" title="35.3. Client Interfaces" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">35.2. Implementation Features</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="lo-intro.html" title="35.1. Introduction">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="largeobjects.html" title="Chapter 35. Large Objects">Up</a></td><th width="60%" align="center">Chapter 35. Large Objects</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="lo-interfaces.html" title="35.3. Client Interfaces">Next</a></td></tr></table><hr /></div><div class="sect1" id="LO-IMPLEMENTATION"><div class="titlepage"><div><div><h2 class="title" style="clear: both">35.2. Implementation Features <a href="#LO-IMPLEMENTATION" class="id_link">#</a></h2></div></div></div><p>3 The large object implementation breaks large4 objects up into <span class="quote">“<span class="quote">chunks</span>”</span> and stores the chunks in5 rows in the database. A B-tree index guarantees fast6 searches for the correct chunk number when doing random7 access reads and writes.8 </p><p>9 The chunks stored for a large object do not have to be contiguous.10 For example, if an application opens a new large object, seeks to offset11 1000000, and writes a few bytes there, this does not result in allocation12 of 1000000 bytes worth of storage; only of chunks covering the range of13 data bytes actually written. A read operation will, however, read out14 zeroes for any unallocated locations preceding the last existing chunk.15 This corresponds to the common behavior of <span class="quote">“<span class="quote">sparsely allocated</span>”</span>16 files in <acronym class="acronym">Unix</acronym> file systems.17 </p><p>18 As of <span class="productname">PostgreSQL</span> 9.0, large objects have an owner19 and a set of access permissions, which can be managed using20 <a class="xref" href="sql-grant.html" title="GRANT"><span class="refentrytitle">GRANT</span></a> and21 <a class="xref" href="sql-revoke.html" title="REVOKE"><span class="refentrytitle">REVOKE</span></a>.22 <code class="literal">SELECT</code> privileges are required to read a large23 object, and24 <code class="literal">UPDATE</code> privileges are required to write or25 truncate it.26 Only the large object's owner (or a database superuser) can delete,27 comment on, or change the owner of a large object.28 To adjust this behavior for compatibility with prior releases, see the29 <a class="xref" href="runtime-config-compatible.html#GUC-LO-COMPAT-PRIVILEGES">lo_compat_privileges</a> run-time parameter.30 </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="lo-intro.html" title="35.1. Introduction">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="largeobjects.html" title="Chapter 35. Large Objects">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="lo-interfaces.html" title="35.3. Client Interfaces">Next</a></td></tr><tr><td width="40%" align="left" valign="top">35.1. Introduction </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 16.3 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 35.3. Client Interfaces</td></tr></table></div></body></html>