MobileBlur

psycopg2-module.html at [50a1ba732d]
Login

psycopg2-module.html at [50a1ba732d]

File applications/examples/static/epydoc/psycopg2-module.html artifact 26fe2ee9c5 part of check-in 50a1ba732d


<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>psycopg2</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="web2py.gluon-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://www.web2py.com">web2py Web Framework</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Package&nbsp;psycopg2
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="psycopg2-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== PACKAGE DESCRIPTION ==================== -->
<h1 class="epydoc">Package psycopg2</h1><span class="codelink"><a href="psycopg2-pysrc.html">source&nbsp;code</a></span><br /><br />
<pre class="literalblock">
A Python driver for PostgreSQL

psycopg is a PostgreSQL_ database adapter for the Python_ programming
language. This is version 2, a complete rewrite of the original code to
provide new-style classes for connection and cursor objects and other sweet
candies. Like the original, psycopg 2 was written with the aim of being very
small and fast, and stable as a rock.

Homepage: http://initd.org/projects/psycopg2

.. _PostgreSQL: http://www.postgresql.org/
.. _Python: http://www.python.org/

:Groups:
  * `Connections creation`: connect
  * `Value objects constructors`: Binary, Date, DateFromTicks, Time,
    TimeFromTicks, Timestamp, TimestampFromTicks

</pre><br /><br />

<hr />
<div class="fields">      <p><strong>Version:</strong>
        2.0.6 (dec mx dt ext pq3)
      </p>
</div><!-- ==================== SUBMODULES ==================== -->
<a name="section-Submodules"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Submodules</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Submodules"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr><td class="summary">
  <ul class="nomargin">
    <li> <strong class="uidlink"><a href="psycopg2.tz-module.html">psycopg2.tz</a></strong>: <em class="summary">tzinfo implementations for psycopg2</em>    </li>
  </ul></td></tr>
</table>

<br />
<!-- ==================== CLASSES ==================== -->
<a name="section-Classes"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Classes</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Classes"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="psycopg2.DataError-class.html" class="summary-name">DataError</a><br />
      Error related to problems with the processed data.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="psycopg2.DatabaseError-class.html" class="summary-name">DatabaseError</a><br />
      Error related to the database engine.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="psycopg2.Error-class.html" class="summary-name">Error</a><br />
      Base class for error exceptions.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="psycopg2.IntegrityError-class.html" class="summary-name">IntegrityError</a><br />
      Error related to database integrity.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="psycopg2.InterfaceError-class.html" class="summary-name">InterfaceError</a><br />
      Error related to the database interface.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="psycopg2.InternalError-class.html" class="summary-name">InternalError</a><br />
      The database encountered an internal error.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="psycopg2.NotSupportedError-class.html" class="summary-name">NotSupportedError</a><br />
      A not supported datbase API was called.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="psycopg2.OperationalError-class.html" class="summary-name">OperationalError</a><br />
      Error related to database operation (disconnect, memory 
        allocation etc).
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="psycopg2.ProgrammingError-class.html" class="summary-name">ProgrammingError</a><br />
      Error related to database programming (SQL error, table not 
        found etc).
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="psycopg2.Warning-class.html" class="summary-name">Warning</a><br />
      A database warning.
    </td>
  </tr>
</table>
<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psycopg2-module.html#Binary" class="summary-sig-name">Binary</a>(<span class="summary-sig-arg">buffer</span>)</span><br />
      Build an object capable to hold a bynary string value.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psycopg2-module.html#Date" class="summary-sig-name">Date</a>(<span class="summary-sig-arg">year</span>,
        <span class="summary-sig-arg">month</span>,
        <span class="summary-sig-arg">day</span>)</span><br />
      Build an object holding a date value.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psycopg2-module.html#DateFromTicks" class="summary-sig-name">DateFromTicks</a>(<span class="summary-sig-arg">ticks</span>)</span><br />
      Build an object holding a date value from the given ticks 
      value.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psycopg2-module.html#Time" class="summary-sig-name">Time</a>(<span class="summary-sig-arg">hour</span>,
        <span class="summary-sig-arg">minutes</span>,
        <span class="summary-sig-arg">seconds</span>,
        <span class="summary-sig-arg">tzinfo</span>=<span class="summary-sig-default">None</span>)</span><br />
      Build an object holding a time value.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psycopg2-module.html#TimeFromTicks" class="summary-sig-name">TimeFromTicks</a>(<span class="summary-sig-arg">ticks</span>)</span><br />
      Build an object holding a time value from the given ticks 
      value.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psycopg2-module.html#Timestamp" class="summary-sig-name">Timestamp</a>(<span class="summary-sig-arg">year</span>,
        <span class="summary-sig-arg">month</span>,
        <span class="summary-sig-arg">day</span>,
        <span class="summary-sig-arg">hour</span>,
        <span class="summary-sig-arg">minutes</span>,
        <span class="summary-sig-arg">seconds</span>,
        <span class="summary-sig-arg">tzinfo</span>=<span class="summary-sig-default">None</span>)</span><br />
      Build an object holding a timestamp value.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psycopg2-module.html#TimestampFromTicks" class="summary-sig-name">TimestampFromTicks</a>(<span class="summary-sig-arg">ticks</span>)</span><br />
      Build an object holding a timestamp value from the given ticks 
      value.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="psycopg2-module.html#connect" class="summary-sig-name">connect</a>(<span class="summary-sig-arg">dsn</span>,
        <span class="summary-sig-arg">...</span>)</span><br />
      Create a new database connection.</td>
          <td align="right" valign="top">
            
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Variables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="BINARY"></a><span class="summary-name">BINARY</span> = <code title="&lt;psycopg2._psycopg.type object at 0xd660a0&gt;">&lt;psycopg2._psycopg.type object at 0xd660a0&gt;</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="DATETIME"></a><span class="summary-name">DATETIME</span> = <code title="&lt;psycopg2._psycopg.type object at 0xd5ef80&gt;">&lt;psycopg2._psycopg.type object at 0xd5ef80&gt;</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="NUMBER"></a><span class="summary-name">NUMBER</span> = <code title="&lt;psycopg2._psycopg.type object at 0xd5ed88&gt;">&lt;psycopg2._psycopg.type object at 0xd5ed88&gt;</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="ROWID"></a><span class="summary-name">ROWID</span> = <code title="&lt;psycopg2._psycopg.type object at 0xd660d8&gt;">&lt;psycopg2._psycopg.type object at 0xd660d8&gt;</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="STRING"></a><span class="summary-name">STRING</span> = <code title="&lt;psycopg2._psycopg.type object at 0xd5ef10&gt;">&lt;psycopg2._psycopg.type object at 0xd5ef10&gt;</code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="apilevel"></a><span class="summary-name">apilevel</span> = <code title="'2.0'"><code class="variable-quote">'</code><code class="variable-string">2.0</code><code class="variable-quote">'</code></code>
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="k"></a><span class="summary-name">k</span> = <code title="'DatabaseError'"><code class="variable-quote">'</code><code class="variable-string">DatabaseError</code><code class="variable-quote">'</code></code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="paramstyle"></a><span class="summary-name">paramstyle</span> = <code title="'pyformat'"><code class="variable-quote">'</code><code class="variable-string">pyformat</code><code class="variable-quote">'</code></code>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="threadsafety"></a><span class="summary-name">threadsafety</span> = <code title="1">1</code><br />
      PyMySQL: A pure-Python drop-in replacement for MySQLdb.
    </td>
  </tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="Binary"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">Binary</span>(<span class="sig-arg">buffer</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  Build an object capable to hold a bynary string value.
  <dl class="fields">
    <dt>Returns:</dt>
        <dd><pre class="literalblock">
new binary object

</pre></dd>
  </dl>
</td></tr></table>
</div>
<a name="Date"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">Date</span>(<span class="sig-arg">year</span>,
        <span class="sig-arg">month</span>,
        <span class="sig-arg">day</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  Build an object holding a date value.
  <dl class="fields">
    <dt>Returns:</dt>
        <dd><pre class="literalblock">
new date

</pre></dd>
  </dl>
</td></tr></table>
</div>
<a name="DateFromTicks"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">DateFromTicks</span>(<span class="sig-arg">ticks</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  <p>Build an object holding a date value from the given ticks value.</p>
  Ticks are the number of seconds since the epoch; see the documentation
  of the standard Python time module for details).
  <dl class="fields">
    <dt>Returns:</dt>
        <dd><pre class="literalblock">
new date

</pre></dd>
  </dl>
</td></tr></table>
</div>
<a name="Time"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">Time</span>(<span class="sig-arg">hour</span>,
        <span class="sig-arg">minutes</span>,
        <span class="sig-arg">seconds</span>,
        <span class="sig-arg">tzinfo</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  Build an object holding a time value.
  <dl class="fields">
    <dt>Returns:</dt>
        <dd><pre class="literalblock">
new time

</pre></dd>
  </dl>
</td></tr></table>
</div>
<a name="TimeFromTicks"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">TimeFromTicks</span>(<span class="sig-arg">ticks</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  <p>Build an object holding a time value from the given ticks value.</p>
  Ticks are the number of seconds since the epoch; see the documentation
  of the standard Python time module for details).
  <dl class="fields">
    <dt>Returns:</dt>
        <dd><pre class="literalblock">
new time

</pre></dd>
  </dl>
</td></tr></table>
</div>
<a name="Timestamp"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">Timestamp</span>(<span class="sig-arg">year</span>,
        <span class="sig-arg">month</span>,
        <span class="sig-arg">day</span>,
        <span class="sig-arg">hour</span>,
        <span class="sig-arg">minutes</span>,
        <span class="sig-arg">seconds</span>,
        <span class="sig-arg">tzinfo</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  Build an object holding a timestamp value.
  <dl class="fields">
    <dt>Returns:</dt>
        <dd><pre class="literalblock">
new timestamp

</pre></dd>
  </dl>
</td></tr></table>
</div>
<a name="TimestampFromTicks"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">TimestampFromTicks</span>(<span class="sig-arg">ticks</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  <p>Build an object holding a timestamp value from the given ticks 
  value.</p>
  Ticks are the number of seconds since the epoch; see the documentation
  of the standard Python time module for details).
  <dl class="fields">
    <dt>Returns:</dt>
        <dd><pre class="literalblock">
new timestamp

</pre></dd>
  </dl>
</td></tr></table>
</div>
<a name="connect"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">connect</span>(<span class="sig-arg">dsn</span>,
        <span class="sig-arg">...</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    >&nbsp;
    </td>
  </table>
  
  <pre class="literalblock">
Create a new database connection.

This function supports two different but equivalent sets of arguments.
A single data source name or ``dsn`` string can be used to specify the
connection parameters, as follows::

    psycopg2.connect(&quot;dbname=xxx user=xxx ...&quot;)

If ``dsn`` is not provided it is possible to pass the parameters as
keyword arguments; e.g.::

    psycopg2.connect(database='xxx', user='xxx', ...)

The full list of available parameters is:

- ``dbname`` -- database name (only in 'dsn')
- ``database`` -- database name (only as keyword argument)
- ``host`` -- host address (defaults to UNIX socket if not provided)
- ``port`` -- port number (defaults to 5432 if not provided)
- ``user`` -- user name used to authenticate
- ``password`` -- password used to authenticate
- ``sslmode`` -- SSL mode (see PostgreSQL documentation)

If the ``connection_factory`` keyword argument is not provided this
function always return an instance of the `connection` class.
Else the given sub-class of `extensions.connection` will be used to
instantiate the connection object.

:return: New database connection
:rtype: `extensions.connection`

</pre>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="web2py.gluon-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://www.web2py.com">web2py Web Framework</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0beta1 on Thu Aug  4 00:46:58 2011
    </td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>