X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id EBF8F3A3BA1 for ; Tue, 23 Nov 2004 04:37:41 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 98552-06 for ; Tue, 23 Nov 2004 04:37:33 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.200]) by svr1.postgresql.org (Postfix) with ESMTP id 031243A3BEE for ; Tue, 23 Nov 2004 04:37:30 +0000 (GMT) Received: by wproxy.gmail.com with SMTP id 71so289475wra for ; Mon, 22 Nov 2004 20:37:30 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=E+lZLFA7pZaCehKtiYDQn8OudZ4ZE475INAQsUEcc9AvOKdBw3ez1Eg0K1lifdT7Fdzp8oR14HxhpiVmz3yrVhgqSnVKvYUtTZzjhhtucjgoydFQJQjHKEMFm1CDDOdi2t/2iTwqJmNVv4BmFflD/4ByNZYOk/lJ5TecUhj0jfY= Received: by 10.54.5.26 with SMTP id 26mr247810wre; Mon, 22 Nov 2004 20:37:23 -0800 (PST) Received: by 10.54.50.36 with HTTP; Mon, 22 Nov 2004 20:37:22 -0800 (PST) Message-ID: <77b69d2104112220372649b6f0@mail.gmail.com> Date: Tue, 23 Nov 2004 10:07:22 +0530 From: "Vishal Kashyap @ [SaiHertz]" Reply-To: "Vishal Kashyap @ [SaiHertz]" To: sreejith s Subject: Re: Image Insert Postgresql DB Cc: pgsql-sql@postgresql.org In-Reply-To: <5d14ecf904112220214ec08992@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <5d14ecf904112220214ec08992@mail.gmail.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/240 X-Sequence-Number: 19559 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