This file is indexed.

/usr/share/doc/libghc-postgresql-simple-doc/html/Database-PostgreSQL-Simple-Copy.html is in libghc-postgresql-simple-doc 0.5.3.0-1build5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!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>Database.PostgreSQL.Simple.Copy</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Database-PostgreSQL-Simple-Copy.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Database-PostgreSQL-Simple-Copy.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">postgresql-simple-0.5.3.0: Mid-Level PostgreSQL client library</p></div><div id="content"><div id="module-header"><table class="info"><tr><th valign="top">Copyright</th><td>(c) 2013 Leon P Smith</td></tr><tr><th>License</th><td>BSD3</td></tr><tr><th>Maintainer</th><td>Leon P Smith &lt;leon@melding-monads.com&gt;</td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Database.PostgreSQL.Simple.Copy</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>mid-level support for COPY IN and COPY OUT.   See
 <a href="https://www.postgresql.org/docs/9.5/static/sql-copy.html">https://www.postgresql.org/docs/9.5/static/sql-copy.html</a> for
 more information.</p><p>To use this binding,  first call <code><a href="Database-PostgreSQL-Simple-Copy.html#v:copy">copy</a></code> with an appropriate
 query as documented in the link above.  Then, in the case of a
 <code>COPY TO STDOUT</code> query,  call <code><a href="Database-PostgreSQL-Simple-Copy.html#v:getCopyData">getCopyData</a></code> repeatedly until it
 returns <code><a href="Database-PostgreSQL-Simple-Copy.html#v:CopyOutDone">CopyOutDone</a></code>.   In the case of a <code>COPY FROM STDIN</code>
 query,  call <code><a href="Database-PostgreSQL-Simple-Copy.html#v:putCopyData">putCopyData</a></code> repeatedly and then finish by calling
 either <code><a href="Database-PostgreSQL-Simple-Copy.html#v:putCopyEnd">putCopyEnd</a></code> to proceed or <code><a href="Database-PostgreSQL-Simple-Copy.html#v:putCopyError">putCopyError</a></code> to abort.</p><p>You cannot issue another query on the same connection while a copy
 is ongoing; this will result in an exception.   It is harmless to
 concurrently call <code>getNotification</code> on a connection while it is in
 a <code>CopyIn</code> or <code>CopyOut</code> state,  however be aware that current versions
 of the PostgreSQL backend will not deliver notifications to a client
 while a transaction is ongoing.</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:copy">copy</a> :: <a href="Database-PostgreSQL-Simple-ToRow.html#t:ToRow">ToRow</a> params =&gt; <a href="Database-PostgreSQL-Simple-Internal.html#t:Connection">Connection</a> -&gt; <a href="Database-PostgreSQL-Simple-Types.html#t:Query">Query</a> -&gt; params -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:copy_">copy_</a> :: <a href="Database-PostgreSQL-Simple-Internal.html#t:Connection">Connection</a> -&gt; <a href="Database-PostgreSQL-Simple-Types.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><span class="keyword">data</span> <a href="#t:CopyOutResult">CopyOutResult</a><ul class="subs"><li>= <a href="#v:CopyOutRow">CopyOutRow</a> !<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></li><li>| <a href="#v:CopyOutDone">CopyOutDone</a> !<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int64">Int64</a></li></ul></li><li class="src short"><a href="#v:getCopyData">getCopyData</a> :: <a href="Database-PostgreSQL-Simple-Internal.html#t:Connection">Connection</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Database-PostgreSQL-Simple-Copy.html#t:CopyOutResult">CopyOutResult</a></li><li class="src short"><a href="#v:putCopyData">putCopyData</a> :: <a href="Database-PostgreSQL-Simple-Internal.html#t:Connection">Connection</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> ()</li><li class="src short"><a href="#v:putCopyEnd">putCopyEnd</a> :: <a href="Database-PostgreSQL-Simple-Internal.html#t:Connection">Connection</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int64">Int64</a></li><li class="src short"><a href="#v:putCopyError">putCopyError</a> :: <a href="Database-PostgreSQL-Simple-Internal.html#t:Connection">Connection</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> ()</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a id="v:copy" class="def">copy</a> :: <a href="Database-PostgreSQL-Simple-ToRow.html#t:ToRow">ToRow</a> params =&gt; <a href="Database-PostgreSQL-Simple-Internal.html#t:Connection">Connection</a> -&gt; <a href="Database-PostgreSQL-Simple-Types.html#t:Query">Query</a> -&gt; params -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () <a href="src/Database-PostgreSQL-Simple-Copy.html#copy" class="link">Source</a> <a href="#v:copy" class="selflink">#</a></p><div class="doc"><p>Issue a <code>COPY FROM STDIN</code> or <code>COPY TO STDOUT</code> query.   In the former
   case, the connection's state will change to <code>CopyIn</code>;  in the latter,
   <code>CopyOut</code>.  The connection must be in the ready state in order
   to call this function.  Performs parameter subsitution.</p></div></div><div class="top"><p class="src"><a id="v:copy_" class="def">copy_</a> :: <a href="Database-PostgreSQL-Simple-Internal.html#t:Connection">Connection</a> -&gt; <a href="Database-PostgreSQL-Simple-Types.html#t:Query">Query</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () <a href="src/Database-PostgreSQL-Simple-Copy.html#copy_" class="link">Source</a> <a href="#v:copy_" class="selflink">#</a></p><div class="doc"><p>Issue a <code>COPY FROM STDIN</code> or <code>COPY TO STDOUT</code> query.   In the former
   case, the connection's state will change to <code>CopyIn</code>;  in the latter,
   <code>CopyOut</code>.  The connection must be in the ready state in order
   to call this function.  Does not perform parameter subsitution.</p></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:CopyOutResult" class="def">CopyOutResult</a> <a href="src/Database-PostgreSQL-Simple-Copy.html#CopyOutResult" class="link">Source</a> <a href="#t:CopyOutResult" class="selflink">#</a></p><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a id="v:CopyOutRow" class="def">CopyOutRow</a> !<a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a></td><td class="doc"><p>Data representing either exactly
   one row of the result,  or header
   or footer data depending on format.</p></td></tr><tr><td class="src"><a id="v:CopyOutDone" class="def">CopyOutDone</a> !<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int64">Int64</a></td><td class="doc"><p>No more rows, and a count of the
   number of rows returned.</p></td></tr></table></div><div class="subs instances"><p id="control.i:CopyOutResult" class="caption collapser" onclick="toggleSection('i:CopyOutResult')">Instances</p><div id="section.i:CopyOutResult" class="show"><table><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:CopyOutResult:Eq:1" class="instance expander" onclick="toggleSection('i:id:CopyOutResult:Eq:1')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Database-PostgreSQL-Simple-Copy.html#t:CopyOutResult">CopyOutResult</a></span> <a href="src/Database-PostgreSQL-Simple-Copy.html#line-104" class="link">Source</a> <a href="#t:CopyOutResult" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:CopyOutResult:Eq:1" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:-61--61-">(==)</a> :: <a href="Database-PostgreSQL-Simple-Copy.html#t:CopyOutResult">CopyOutResult</a> -&gt; <a href="Database-PostgreSQL-Simple-Copy.html#t:CopyOutResult">CopyOutResult</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-61--61-" class="selflink">#</a></p><p class="src"><a href="#v:-47--61-">(/=)</a> :: <a href="Database-PostgreSQL-Simple-Copy.html#t:CopyOutResult">CopyOutResult</a> -&gt; <a href="Database-PostgreSQL-Simple-Copy.html#t:CopyOutResult">CopyOutResult</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="#v:-47--61-" class="selflink">#</a></p></div></div></td></tr><tr><td class="src clearfix"><span class="inst-left"><span id="control.i:id:CopyOutResult:Show:2" class="instance expander" onclick="toggleSection('i:id:CopyOutResult:Show:2')"></span> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:Show">Show</a> <a href="Database-PostgreSQL-Simple-Copy.html#t:CopyOutResult">CopyOutResult</a></span> <a href="src/Database-PostgreSQL-Simple-Copy.html#line-104" class="link">Source</a> <a href="#t:CopyOutResult" class="selflink">#</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div id="section.i:id:CopyOutResult:Show:2" class="inst-details hide"><div class="subs methods"><p class="caption">Methods</p><p class="src"><a href="#v:showsPrec">showsPrec</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="Database-PostgreSQL-Simple-Copy.html#t:CopyOutResult">CopyOutResult</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showsPrec" class="selflink">#</a></p><p class="src"><a href="#v:show">show</a> :: <a href="Database-PostgreSQL-Simple-Copy.html#t:CopyOutResult">CopyOutResult</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-String.html#t:String">String</a> <a href="#v:show" class="selflink">#</a></p><p class="src"><a href="#v:showList">showList</a> :: [<a href="Database-PostgreSQL-Simple-Copy.html#t:CopyOutResult">CopyOutResult</a>] -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Text-Show.html#t:ShowS">ShowS</a> <a href="#v:showList" class="selflink">#</a></p></div></div></td></tr></table></div></div></div><div class="top"><p class="src"><a id="v:getCopyData" class="def">getCopyData</a> :: <a href="Database-PostgreSQL-Simple-Internal.html#t:Connection">Connection</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="Database-PostgreSQL-Simple-Copy.html#t:CopyOutResult">CopyOutResult</a> <a href="src/Database-PostgreSQL-Simple-Copy.html#getCopyData" class="link">Source</a> <a href="#v:getCopyData" class="selflink">#</a></p><div class="doc"><p>Retrieve some data from a <code>COPY TO STDOUT</code> query.   A connection
   must be in the <code>CopyOut</code> state in order to call this function.  If this
   returns a <code><a href="Database-PostgreSQL-Simple-Copy.html#v:CopyOutRow">CopyOutRow</a></code>, the connection remains in the <code>CopyOut</code> state,
   if it returns <code><a href="Database-PostgreSQL-Simple-Copy.html#v:CopyOutDone">CopyOutDone</a></code>, then the connection has reverted to the
   ready state.</p></div></div><div class="top"><p class="src"><a id="v:putCopyData" class="def">putCopyData</a> :: <a href="Database-PostgreSQL-Simple-Internal.html#t:Connection">Connection</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () <a href="src/Database-PostgreSQL-Simple-Copy.html#putCopyData" class="link">Source</a> <a href="#v:putCopyData" class="selflink">#</a></p><div class="doc"><p>Feed some data to a <code>COPY FROM STDIN</code> query.  Note that
   the data does not need to represent a single row,  or even an
   integral number of rows.  The net result of
   <code>putCopyData conn a &gt;&gt; putCopyData conn b</code>
   is the same as <code>putCopyData conn c</code> whenever <code>c == BS.append a b</code>.</p><p>A connection must be in the <code>CopyIn</code> state in order to call this
   function,  otherwise a <code><a href="Database-PostgreSQL-Simple-Internal.html#t:SqlError">SqlError</a></code> exception will result.  The
   connection remains in the <code>CopyIn</code> state after this function
   is called.</p></div></div><div class="top"><p class="src"><a id="v:putCopyEnd" class="def">putCopyEnd</a> :: <a href="Database-PostgreSQL-Simple-Internal.html#t:Connection">Connection</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int64">Int64</a> <a href="src/Database-PostgreSQL-Simple-Copy.html#putCopyEnd" class="link">Source</a> <a href="#v:putCopyEnd" class="selflink">#</a></p><div class="doc"><p>Completes a <code>COPY FROM STDIN</code> query.  Returns the number of rows
   processed.</p><p>A connection must be in the <code>CopyIn</code> state in order to call this
   function,  otherwise a <code><a href="Database-PostgreSQL-Simple-Internal.html#t:SqlError">SqlError</a></code> exception will result.  The
   connection's state changes back to ready after this function
   is called.</p></div></div><div class="top"><p class="src"><a id="v:putCopyError" class="def">putCopyError</a> :: <a href="Database-PostgreSQL-Simple-Internal.html#t:Connection">Connection</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.8.1/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> () <a href="src/Database-PostgreSQL-Simple-Copy.html#putCopyError" class="link">Source</a> <a href="#v:putCopyError" class="selflink">#</a></p><div class="doc"><p>Aborts a <code>COPY FROM STDIN</code> query.  The string parameter is simply
   an arbitrary error message that may show up in the PostgreSQL
   server's log.</p><p>A connection must be in the <code>CopyIn</code> state in order to call this
   function,  otherwise a <code><a href="Database-PostgreSQL-Simple-Internal.html#t:SqlError">SqlError</a></code> exception will result.  The
   connection's state changes back to ready after this function
   is called.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>