pgsql-server/src/interfaces/python pgmodule.c

Поиск
Список
Период
Сортировка
От momjian@postgresql.org (Bruce Momjian - CVS)
Тема pgsql-server/src/interfaces/python pgmodule.c
Дата
Msg-id 20021206031928.D4AED476341@postgresql.org
обсуждение исходный текст
Список pgsql-committers
CVSROOT:    /cvsroot
Module name:    pgsql-server
Changes by:    momjian@postgresql.org    02/12/05 22:19:28

Modified files:
    src/interfaces/python: pgmodule.c

Log message:
    PyGreSQL inserttable patch
    =====================

    I suggested an improvement of the inserttable in the PyGreSQL interface
    already in January, but seemingly it was never implemented. I was told this
    is the right place to get patches in for PyGreSQL, so I'm reposting my patch
    here.

    I consider the inserttable methode essential in populating the database
    because of its benefits in performance compared to insert, so I think this
    patch is quite essential. The attachment is an improved version of the
    corresponding pg_inserttable function in pgmodule.c, which fixes the
    following problems:

    * The function raised exceptions because PyList_GetItem was used beyond the
    size of the list. This was checked by comparing the result with NULL, but
    the exception was not cleaned up, which could result in mysterious errors in
    the following Python code. Instead of clearing the exception using
    PyErr_Clear or something like that, I avoided throwing the exception at all
    by at first requesting the size of the list. Using this opportunity, I also
    checked the uniformity of the size of the rows passed in the lists/tuples.
    The function also accepts (and silently ignores) empty lists and sublists.
    * Python "None" values are now accepted and properly converted to PostgreSQL
    NULL values
    * The function now generates an error message in case of a line buffer
    overflow
    * It copes with tabulators, newlines and backslashes in strings now
    * Rewrote the buffer filling code which should now run faster by avoiding
    unnecessary string copy operations forth and back

    Christoph Zwerschke


В списке pgsql-committers по дате отправления:

Предыдущее
От: momjian@postgresql.org (Bruce Momjian - CVS)
Дата:
Сообщение: pgsql-server/doc/src/sgml/ref truncate.sgml
Следующее
От: momjian@postgresql.org (Bruce Momjian - CVS)
Дата:
Сообщение: pgsql-server/ oc/src/sgml/reference.sgml oc/sr ...