Re: large objects and pg 7.3.x - Mailing list pgsql-odbc
From | Andre Felipe Machado |
---|---|
Subject | Re: large objects and pg 7.3.x |
Date | |
Msg-id | 200308200823.10134.andremachado@techforce.com.br Whole thread Raw |
In response to | Re: large objects and pg 7.3.x ("Julie May" <julie@ccorb.com>) |
List | pgsql-odbc |
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 the 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 the 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 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 "GIF87a\216\000\076\000\367\000\000\000\000\000\000\000\100\000\000\200\000\000ÿ\000 \000\000 \100\000 \200\000 ÿ\000\100\000\000\100\100\000\100\200\000\100ÿ\000\140\000\000\140\100\000\140\200\000\140ÿ\000\200\000\000\200\100\000\200\200\000\200ÿ\000\240\000\000\240\100\000\240\200\000\240ÿ\000À\000\000À\100\000À\200\000Àÿ\000ÿ\000\000ÿ\100\000ÿ\200\000ÿÿ \000\000 \000\100 \000\200 \000ÿ \000 \100 \200 ÿ \100\000 \100\100 The error is very similar to the one issued when using another db with the postgresql/contrib/lo functions. It seems that the image is being escaped to octal before parsing to the 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ça 19 Agosto 2003 20:25, você 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 functions > : 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 > > <snip> > ----- Original Message ----- > From: "Andre Felipe Machado" <andremachado@techforce.com.br> > > > The postgresql psql tool can insert an image (can also extracts it) using > > 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 > > </snip>
pgsql-odbc by date: