Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 067A09FA602 for ; Wed, 18 Apr 2007 11:27:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 28143-02 for ; Wed, 18 Apr 2007 11:27:40 -0300 (ADT) X-Greylist: delayed 00:06:39.697294 by SQLgrey-1.7.4 Received: from web26611.mail.ukl.yahoo.com (web26611.mail.ukl.yahoo.com [217.146.177.63]) by postgresql.org (Postfix) with SMTP id 2CAFA9FA5E5 for ; Wed, 18 Apr 2007 11:27:45 -0300 (ADT) Received: (qmail 24938 invoked by uid 60001); 18 Apr 2007 14:21:04 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.es; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type; b=jDd4l/8SKu9WGUwvsmUU8OCOC7PH7wUcFhOJIAz2lMbhQNu2eSKBeEERAEijBWUENHxG7rzvy3+kSiz2+rOqTHZFf3n2J/jGORiLjVG4KtgBsHeaWL4hZItJIqt9tWuNRebBdNTlocRUSud6yYap4gdF81Ph0YU/KBjjiLXPDgc= ; Message-ID: <20070418142104.24936.qmail@web26611.mail.ukl.yahoo.com> X-YMail-OSG: KTP2GLgVM1m1ko_VaGvcGUI2Hg37IlcTmZcAYd.NngfHwyzEvIzdzQ_snIAu3tCzX8QyWqB1kkUJnAwddKsvgl.cgwrd4Ky5dEkyYYy9nK5HezLNRmZ2jk71Vu8- Received: from [158.42.168.142] by web26611.mail.ukl.yahoo.com via HTTP; Wed, 18 Apr 2007 14:21:04 GMT X-Mailer: YahooMailRC/478 YahooMailWebService/0.7.41.10 Date: Wed, 18 Apr 2007 14:21:04 +0000 (GMT) From: =?iso-8859-1?Q?Miguel_Garc=EDa?= Subject: Re: lo_write and lo_import does not work! To: Alvaro Herrera Cc: pgsql-interfaces@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1373585796-1176906064=:23663" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.605 tagged_above=0 required=5 tests=AWL=0.093, BAYES_40=-0.185, DNS_FROM_RFC_ABUSE=0.2, HTML_40_50=0.496, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200704/12 X-Sequence-Number: 6500 --0-1373585796-1176906064=:23663 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable It works!!=0A=0AThank you very much.=0A=0A----- Mensaje original ----=0ADe:= Alvaro Herrera =0APara: Miguel Garc=EDa =0ACC: pgsql-interfaces@postgresql.org=0AEnviado: mi=E9rcoles, = 18 de abril, 2007 16:02:47=0AAsunto: Re: [INTERFACES] lo_write and lo_impor= t does not work!=0A=0AMiguel Garc=EDa escribi=F3:=0A> Hello,=0A> =0A> I hav= e a little trouble using large objects with libpq an postgresql=0A> 8.2 in = windows xp professional SP2.=0A> =0A> I want to save and load large objects= from/to database, but its fails.=0A> =0A> If i try to use the lo_import() = function=0A> =0A> #define FILE_IN "d:/question-icon.png"=0A> Oid file_oid = =3D lo_import (conn, FILE_IN);=0A> =0A> file_oid always have 0 value, never= theless the large object has been created in table=0A> pg_largeobject, but = has no data.=0A=0AI think your problem is that you are not running the comm= ands inside a=0Atransaction. Large object IDs are closed at the end of the= transaction=0Ablock, which is right after the lo_open unless you're callin= g BEGIN=0Afirst (or are not in autocommit mode, which is the default).=0A= =0A-- =0AAlvaro Herrera http://www.CommandPr= ompt.com/=0APostgreSQL Replication, Consulting, Custom Development, 24x7 su= pport=0A=0A=0A=0A=0A=0A=0A=0A =0A____________________________________= ________________________________________________=0ALLama Gratis a cualquier= PC del Mundo. =0ALlamadas a fijos y m=F3viles desde 1 c=E9ntimo por minuto= . =0Ahttp://es.voice.yahoo.com --0-1373585796-1176906064=:23663 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
It works!!

Thank you very much.

----- Mensaje original ----
De: Alvaro Herrera <alvherre@commandpr= ompt.com>
Para: Miguel Garc=EDa <rocho08@yahoo.es>
CC: pgsql= -interfaces@postgresql.org
Enviado: mi=E9rcoles, 18 de abril, 2007 16:02= :47
Asunto: Re: [INTERFACES] lo_write and lo_import does not work!
Miguel Garc=EDa escribi=F3:
> 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 larg= e objects from/to database, but its fails.
>
> If i try to use= the lo_import() function
>
> #define FILE_IN "d:/question-icon.png"
> O= id file_oid =3D lo_import (conn, FILE_IN);
>
> file_oid always= have 0 value, nevertheless the large object has been created in table
&= gt; pg_largeobject, but has no data.

I think your problem is that yo= u are not running the commands inside a
transaction.  Large ob= ject 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 autoc= ommit mode, which is the default).

--
Alvaro Herrera  =             &nb= sp;            =      http://www.CommandPrompt.com/
PostgreSQL Replication,= Consulting, Custom Development, 24x7 support


=0A=0A=0A

LL= ama Gratis a cualquier PC del Mundo.
Llamadas a fijos y m=F3viles desde = 1 c=E9ntimo por minuto.
http://es.voice.yahoo.com --0-1373585796-1176906064=:23663--