Re: lo_write and lo_import does not work!

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: lo_write and lo_import does not work!
Дата
Msg-id 20070418140247.GA7356@alvh.no-ip.org
обсуждение исходный текст
Ответ на lo_write and lo_import does not work!  (Miguel García <rocho08@yahoo.es>)
Список pgsql-interfaces
Miguel García escribió:
> Hello,
> 
> I have a little trouble using large objects with libpq an postgresql
> 8.2 in windows xp professional SP2.
> 
> I want to save and load large objects from/to database, but its fails.
> 
> If i try to use the lo_import() function
> 
> #define FILE_IN "d:/question-icon.png"
> Oid file_oid = lo_import (conn, FILE_IN);
> 
> file_oid always have 0 value, nevertheless the large object has been created in table
> pg_largeobject, but has no data.

I think your problem is that you are not running the commands inside a
transaction.  Large object IDs are closed at the end of the transaction
block, which is right after the lo_open unless you're calling BEGIN
first (or are not in autocommit mode, which is the default).

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


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

Предыдущее
От: Miguel García
Дата:
Сообщение: lo_write and lo_import does not work!
Следующее
От: Miguel García
Дата:
Сообщение: Re: lo_write and lo_import does not work!