Fixed docs for the copy null parameter

This commit is contained in:
Daniele Varrazzo 2011-10-20 11:07:24 +01:00
parent 2671472de8
commit 83d457361e

View File

@ -457,7 +457,7 @@ The ``cursor`` class
The :sql:`COPY` command is a PostgreSQL extension to the SQL standard. The :sql:`COPY` command is a PostgreSQL extension to the SQL standard.
As such, its support is a Psycopg extension to the |DBAPI|. As such, its support is a Psycopg extension to the |DBAPI|.
.. method:: copy_from(file, table, sep='\\t', null='\\N', size=8192, columns=None) .. method:: copy_from(file, table, sep='\\t', null='\\\\N', size=8192, columns=None)
Read data *from* the file-like object *file* appending them to Read data *from* the file-like object *file* appending them to
the table named *table*. See :ref:`copy` for an overview. the table named *table*. See :ref:`copy` for an overview.
@ -467,6 +467,7 @@ The ``cursor`` class
:param table: name of the table to copy data into. :param table: name of the table to copy data into.
:param sep: columns separator expected in the file. Defaults to a tab. :param sep: columns separator expected in the file. Defaults to a tab.
:param null: textual representation of :sql:`NULL` in the file. :param null: textual representation of :sql:`NULL` in the file.
The default is the two character string ``\N``.
:param size: size of the buffer used to read from the file. :param size: size of the buffer used to read from the file.
:param columns: iterable with name of the columns to import. :param columns: iterable with name of the columns to import.
The length and types should match the content of the file to read. The length and types should match the content of the file to read.
@ -489,7 +490,7 @@ The ``cursor`` class
are encoded in the connection `~connection.encoding` when sent to are encoded in the connection `~connection.encoding` when sent to
the backend. the backend.
.. method:: copy_to(file, table, sep='\\t', null='\\N', columns=None) .. method:: copy_to(file, table, sep='\\t', null='\\\\N', columns=None)
Write the content of the table named *table* *to* the file-like Write the content of the table named *table* *to* the file-like
object *file*. See :ref:`copy` for an overview. object *file*. See :ref:`copy` for an overview.
@ -499,6 +500,7 @@ The ``cursor`` class
:param table: name of the table to copy data from. :param table: name of the table to copy data from.
:param sep: columns separator expected in the file. Defaults to a tab. :param sep: columns separator expected in the file. Defaults to a tab.
:param null: textual representation of :sql:`NULL` in the file. :param null: textual representation of :sql:`NULL` in the file.
The default is the two character string ``\N``.
:param columns: iterable with name of the columns to export. :param columns: iterable with name of the columns to export.
If not specified, export all the columns. If not specified, export all the columns.