Re: Image Insert Postgresql DB - Mailing list pgsql-sql

From Vishal Kashyap @ [SaiHertz]
Subject Re: Image Insert Postgresql DB
Date
Msg-id 77b69d2104112220372649b6f0@mail.gmail.com
Whole thread Raw
In response to Image Insert Postgresql DB  (sreejith s <getsreejith@gmail.com>)
List pgsql-sql
Dear Shreejith ,


> Data type for Image
> field in the DB is OID.
> copy of Image file actually resides in the client. V have to insert
> this image into the DB.


Firtsly crosscheck the data type is OID it must be either bytea or blob.

> 
> Query to insert
> ----------------
> INSERT INTO Imagetable VALUES (lo_import('C:\\image\\peach.jpg'));

Out of experience I would suggest you to keep images on the file
system as database with images in it would be bulky and would takes
loads of time to restore and backup.
If these do not bother you continue  with it.

Thats Pascal ??

Dont know about pascal but you would have to stream the file to the
server. I doubt that PostgreSQL will fetch from the client.
In PHP we would have Posted the file and exected the insert query


Hope this helps you.


-- 
With Best Regards,
Vishal Kashyap.
Lead Software Developer,
http://saihertz.com,
http://vishalkashyap.tk


pgsql-sql by date:

Previous
From: sreejith s
Date:
Subject: Image Insert Postgresql DB
Next
From: Kenneth Gonsalves
Date:
Subject: Re: Image Insert Postgresql DB