| | 1 | # vim: sw=4:expandtab:foldmethod=marker |
|---|
| | 2 | # |
|---|
| | 3 | # Copyright (c) 2007, Mathieu Fenniak |
|---|
| | 4 | # All rights reserved. |
|---|
| | 5 | # |
|---|
| | 6 | # Redistribution and use in source and binary forms, with or without |
|---|
| | 7 | # modification, are permitted provided that the following conditions are |
|---|
| | 8 | # met: |
|---|
| | 9 | # |
|---|
| | 10 | # * Redistributions of source code must retain the above copyright notice, |
|---|
| | 11 | # this list of conditions and the following disclaimer. |
|---|
| | 12 | # * Redistributions in binary form must reproduce the above copyright notice, |
|---|
| | 13 | # this list of conditions and the following disclaimer in the documentation |
|---|
| | 14 | # and/or other materials provided with the distribution. |
|---|
| | 15 | # * The name of the author may not be used to endorse or promote products |
|---|
| | 16 | # derived from this software without specific prior written permission. |
|---|
| | 17 | # |
|---|
| | 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
|---|
| | 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|---|
| | 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|---|
| | 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
|---|
| | 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|---|
| | 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
|---|
| | 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
|---|
| | 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
|---|
| | 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
|---|
| | 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|---|
| | 28 | # POSSIBILITY OF SUCH DAMAGE. |
|---|
| | 29 | |
|---|
| | 30 | __author__ = "Mathieu Fenniak" |
|---|
| | 31 | |
|---|
| 54 | | |
|---|
| | 85 | ## |
|---|
| | 86 | # This class represents a connection to a PostgreSQL database. |
|---|
| | 87 | # <p> |
|---|
| | 88 | # A single PostgreSQL connection can only perform a single query at a time, |
|---|
| | 89 | # which is an important restriction to note. This limitation can be overcome |
|---|
| | 90 | # by retrieving all results immediately after a query, but this approach is not |
|---|
| | 91 | # taken by this library. |
|---|
| | 92 | # <p> |
|---|
| | 93 | # Stability: Added in v1.00, stability guaranteed for v1.xx. |
|---|
| | 94 | # |
|---|
| | 95 | # @param host The hostname of the PostgreSQL server to connect with. Only |
|---|
| | 96 | # TCP/IP connections are presently supported, so this parameter is mandatory. |
|---|
| | 97 | # |
|---|
| | 98 | # @param user The username to connect to the PostgreSQL server with. This |
|---|
| | 99 | # parameter is mandatory. |
|---|
| | 100 | # |
|---|
| | 101 | # @param port The TCP/IP port of the PostgreSQL server instance. This |
|---|
| | 102 | # parameter defaults to 5432, the registered and common port of PostgreSQL |
|---|
| | 103 | # TCP/IP servers. |
|---|
| | 104 | # |
|---|
| | 105 | # @param database The name of the database instance to connect with. This |
|---|
| | 106 | # parameter is optional, if omitted the PostgreSQL server will assume the |
|---|
| | 107 | # database name is the same as the username. |
|---|
| | 108 | # |
|---|
| | 109 | # @param password The user password to connect to the server with. This |
|---|
| | 110 | # parameter is optional. If omitted, and the database server requests password |
|---|
| | 111 | # based authentication, the connection will fail. On the other hand, if this |
|---|
| | 112 | # parameter is provided and the database does not request password |
|---|
| | 113 | # authentication, then the password will not be used. |
|---|