X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id CBDF99FB1D7 for ; Thu, 3 Aug 2006 01:05:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 86758-09 for ; Thu, 3 Aug 2006 04:05:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.191]) by postgresql.org (Postfix) with ESMTP id 5F3C99FA154 for ; Thu, 3 Aug 2006 01:05:10 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id p77so903126nfc for ; Wed, 02 Aug 2006 21:05:07 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=rPie7xVN2OoUaSYtk8XgLoMnhj6BTHWjYytjX9wnU/6kAU/GQeRslJAG7mgByQ9Slb/L7anOE7ukbEQN6NuvL+LDgjXdky4GxYdTZDKRL+6lEXXnFNNAQqh17yLwmHLTKFfRqQD+Qp6WVgG0qKkMkfi830YdfU4S0L7UVaQT8ZA= Received: by 10.78.133.10 with SMTP id g10mr609530hud; Wed, 02 Aug 2006 21:05:07 -0700 (PDT) Received: by 10.78.32.10 with HTTP; Wed, 2 Aug 2006 21:05:06 -0700 (PDT) Message-ID: Date: Wed, 2 Aug 2006 23:05:07 -0500 From: "Aaron Bono" To: "=?ISO-8859-1?Q?Rodrigo_De_Le=F3n?=" Subject: Re: Problem while using lo_import and lo_export Cc: pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_101778_28161957.1154577907210" References: X-Google-Sender-Auth: 638fc9e65dc87a5c X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=4.366 tagged_above=0 required=5 tests=HTML_30_40, HTML_MESSAGE, NORMAL_HTTP_TO_IP, SPF_HELO_SOFTFAIL, SPF_SOFTFAIL X-Spam-Level: **** X-Archive-Number: 200608/25 X-Sequence-Number: 25983 ------=_Part_101778_28161957.1154577907210 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 8/2/06, Rodrigo De Le=F3n wrote: > > On 8/2/06, Aaron Bono wrote: > > On 8/2/06, Penchalaiah P. wrote: > > > Hi, > > > > > > I have PostgresSQL database connection from server. Server ip is > > 172.16.5.179 > > > > > > Now I want use lo_import and lo_export function for storing images > into > > the database. > > > > > > This images is located in my system itself. > > > > > > When I am going using the following query=85 > > > > > > Insert into image > > values('chanukya',lo_import('D:/Vivek/Personal/PICS/IN/chanukya.jpg')) > > > > > > =85.it rises error 'no such file or directory' > > > > Looks like you are running on a Windows machine. Did you try: > > > > Insert into image > > values('chanukya',lo_import('D:\Vivek\Personal\PICS\IN\chanukya.jpg')); > > > > Windows uses \, not /. I am not sure if PostgreSQL will translate for > you > > like Java does. > > I believe PostgreSQL accepts slashes as a separator on Win32 (I used > it that way with COPY), but if you want to use backslashes, you have > to escape them: > > INSERT INTO IMAGE > VALUES ('chanukya', > lo_import('D:\\Vivek\\Personal\\PICS\\IN\\chanukya.jpg')); > > Also, I'm not sure if Penchalaiah means that "Server" =3D "my system > itself", double check on that. Good point. I presume that PostgreSQL will look at the path relative to th= e server, not the client. I personally keep my files in CVS and just put references to the files in PostgreSQL. Of course, I had to write the code that automatically checks the files into CVS but it works quite well. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Aaron Bono Aranya Software Technologies, Inc. http://www.aranya.com =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ------=_Part_101778_28161957.1154577907210 Content-Type: text/html; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 8/2/06, Rodrigo De Le=F3n <rdeleonp@gmail.com> wrote:
On 8/2/06, Aaron Bono <postgres= ql@aranya.com> wrote:
> On 8/2/06, Penchalaiah P. <penchalaiahp@infics.com> wrote:<= br> > > Hi,
> >
> > I have PostgresSQL database connect= ion from server. Server ip is
> 172.1= 6.5.179
> >
> > Now I want use lo_import and &nb= sp;lo_export function for storing images into
> the database.
> >
> > This images is located in = my system itself.
> >
> > When I am going using the follo= wing query=85
> >
> > Insert into image
> values('c= hanukya',lo_import('D:/Vivek/Personal/PICS/IN/chanukya.jpg'))
> >
> > =85.it rises error 'no such file or directory'>
> Looks like you are running on a Windows machine.  = Did you try:
>
> Insert into image
> values('chanukya',lo= _import('D:\Vivek\Personal\PICS\IN\chanukya.jpg'));
>
> Windows uses \, not /.  I am not sure if Postgre= SQL will translate for you
> like Java does.

I believe Postgre= SQL accepts slashes as a separator on Win32 (I used
it that way with COP= Y), but if you want to use backslashes, you have
to escape them:

INSERT INTO IMAGE
VALUES ('chanukya', lo_impo= rt('D:\\Vivek\\Personal\\PICS\\IN\\chanukya.jpg'));

Also, I'm not su= re if Penchalaiah means that "Server" =3D "my system
itse= lf", double check on that.

 
Good point.  I presume that PostgreS= QL will look at the path relative to the server, not the client.  I pe= rsonally keep my files in CVS and just put references to the files in Postg= reSQL.  Of course, I had to write the code that automatically checks t= he files into CVS but it works quite well.

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 &n= bsp; Aaron Bono
   Aranya Software Technologies, Inc.
 = ;  http://www.aranya.com
=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ------=_Part_101778_28161957.1154577907210--