X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 15500D1D18C for ; Wed, 20 Aug 2003 08:24:01 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 17761-06 for ; Wed, 20 Aug 2003 08:23:48 -0300 (ADT) Received: from rigel.pucrs.br (rigel.pucrs.br [200.132.10.13]) by svr1.postgresql.org (Postfix) with ESMTP id C2701D1D0C4 for ; Wed, 20 Aug 2003 08:23:44 -0300 (ADT) Received: (from root@localhost) by rigel.pucrs.br (8.12.9/8.12.9) id h7KBFMwt049184 for pgsql-odbc@postgresql.org; Wed, 20 Aug 2003 08:15:22 -0300 (EST) Received: from 200.132.57.38 ([200.132.57.38]) by rigel.pucrs.br (8.12.9/8.12.9) with ESMTP id h7KBFLYs049156 for ; Wed, 20 Aug 2003 08:15:22 -0300 (EST) From: Andre Felipe Machado To: Subject: Re: large objects and pg 7.3.x Date: Wed, 20 Aug 2003 08:23:08 -0300 User-Agent: KMail/1.5.2 References: <00ea01c36661$ffa944d0$3d283ddb@PbgX> <200308191216.02961.andremachado@techforce.com.br> <018701c366a9$3aea84e0$a1d2a8c0@impsu.net> In-Reply-To: <018701c366a9$3aea84e0$a1d2a8c0@impsu.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200308200823.10134.andremachado@techforce.com.br> X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/42 X-Sequence-Number: 3162 Hello, Julie Many thanks for your message. Any hint will be helpfull. I verified again and the functions are there. Also, I created a trigger for the lo_manage() function, following exactly t= he=20 instructions of the contrib/lo readme. Could you tell how do you successfully insert images using the psqlodbc? I guess the problem is that openoffice creates a prepared sql and parses th= e=20 lo "by value", as it expects lo to be as a "normal" blob type. The domain approach should solve this issue. But this theory should be confirmed by another experiment: I created a clean db, then declared lo as a domain (following mr. Lane=20 suggestion) and tried to insert an image. OpenOffice issued the following error: Error inserting the new record SQL Status 01000 Error code -1 [unixODBC]Error while executing the query (non-fatal); ERROR: oidin: error in=20 "GIF87a\216\000\076\000\367\000\000\000\000\000\000\000\100\000\000\200\000= \000=FF\000=20 \000\000 \100\000 \200\000=20 =FF\000\100\000\000\100\100\000\100\200\000\100=FF\000\140\000\000\140\100\= 000\140\200\000\140=FF\000\200\000\000\200\100\000\200\200\000\200=FF\000\2= 40\000\000\240\100\000\240\200\000\240=FF\000=C0\000\000=C0\100\000=C0\200\= 000=C0=FF\000=FF\000\000=FF\100\000=FF\200\000=FF=FF=20 \000\000 \000\100 \000\200 \000=FF \000 \100 \200 =FF \100\000 \100\100 The error is very similar to the one issued when using another db with the= =20 postgresql/contrib/lo functions. It seems that the image is being escaped to octal before parsing to the=20 driver, as it should be for use with bytea pg type. The previously sent sql log session file was of any help? Regards. Andre Felipe Em Ter=E7a 19 Agosto 2003 20:25, voc=EA escreveu: > I am able to insert an image into postgresql using the psqlodbc driver. I > created the lo type using the files in the contrib directory. I was never > able to make the lo_manage() function work. Instead I created my own > functions and used triggers to execute them. I only needed the functions > for deleting and updating records. I haven't had any problems inserting. > When the lo type was created it should have created the following functio= ns > : lo(oid) > lo_in(cstring) > lo_manage() > lo_oid(public.lo) > lo_out(public.lo) > oid(public.lo) > > I hope that is somewhat helpfull. > > Julie > > > ----- Original Message ----- > From: "Andre Felipe Machado" > > > The postgresql psql tool can insert an image (can also extracts it) usi= ng > > direct sql commands. And OpenOffice can display it at the form. > > When trying to save a new record, containing a new image, the program > > complains. > > The error message is reproduced at near the end of the attached sql log > > file. > > > I hope this help. > > Regards. > > Andre Felipe > >