Re: lo_write and lo_import does not work!

From: Miguel García <rocho08(at)yahoo(dot)es>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: lo_write and lo_import does not work!
Date: 2007-04-18 14:21:04
Message-ID: 20070418142104.24936.qmail@web26611.mail.ukl.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

It works!!

Thank you very much.

----- Mensaje original ----
De: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Para: Miguel García <rocho08(at)yahoo(dot)es>
CC: pgsql-interfaces(at)postgresql(dot)org
Enviado: miércoles, 18 de abril, 2007 16:02:47
Asunto: Re: [INTERFACES] lo_write and lo_import does not work!

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


____________________________________________________________________________________
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com

Browse pgsql-interfaces by date

  From Date Subject
Next Message John DeSoi 2007-04-19 02:03:12 Re: Implementing Frontend/Backend Protocol
Previous Message Alvaro Herrera 2007-04-18 14:02:47 Re: lo_write and lo_import does not work!