From: | WZhang <wzhang(at)ic(dot)sunysb(dot)edu> |
---|---|
To: | pgsql-odbc(at)postgresql(dot)org |
Subject: | pgsql and pictures |
Date: | 2002-09-13 15:33:17 |
Message-ID: | Pine.GSO.4.21.0209131109520.5184-100000@sparky.ic.sunysb.edu |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-odbc |
I try to setup a table with one column has pictures. The client side will
be on windows.
By follow the instruction on the ODBC site I setup a new type lo on the
database.
I was able to export some MS Access table with imageobject
in one of the columns to the PostgreSQL server running on a linux
server. And I could import the table back with the imageobject.
I would like to write a client in Python to do the same thing.
Here is my problems and question:
1)When I creat table using this with psql :
CREATE table image(id integer, image oid)
and insert a image using this:
Insert into image(1, lo_import('\tmp\picture1.jpb')
Then I go back to windows and use access import the table image, all I get
is the (1, 16678) not the picture itself.
I said Ok, I will create a table from psql on the server like this:
CREATE table image(id integer, image lo)
now I do not know how to insert a record from there.
2)When I try to wirte the client myself, what command I should use to
retrieve a table with one column a image? if I fetchall() the image table
I will get (1, 16678), how do I get the image?
Could anybody give me some example or idea on how to do this.
Thanks.
Wenhua
From | Date | Subject | |
---|---|---|---|
Next Message | david williams | 2002-09-13 15:37:37 | How do I return a cursor thought the ODBC driver |
Previous Message | Jai Beales | 2002-09-13 15:24:55 | Re: postres, odbc and adox |