Pygresql importing of largeobjects with loimport

Поиск
Список
Период
Сортировка
От Erny
Тема Pygresql importing of largeobjects with loimport
Дата
Msg-id 3b0c7b26@news
обсуждение исходный текст
Список pgsql-interfaces
Dear everybody,

This:
>>> import pg
>>> db=pg.DB()
>>> db.loimport("/myfile")

does not work, because Postgres requires to include this in a transaction.
So hou have to:
>>> import pg
>>> db=pg.DB()
>>> db.query("BEGIN")
>>> db.loimport("/myfile")
>>> db.query("END")                # or COMMIT

Note that this is not necessary if doing a
db.query("select lo_import('/myfile')")
which is not the same as in the first example, is accessed locally from
libpq, and in the second example it is loaded from within the server, so it
must be accessible by the servir with the specified path.

Erny






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

Предыдущее
От: Hans-Jürgen Schönig
Дата:
Сообщение: ECPG error: break statement not within loop or switch
Следующее
От: Iassen Hristov
Дата:
Сообщение: dbExpress driver for PostgreSQL