Question on Escape-string

From: "John Zhang" <johnzhang06(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Question on Escape-string
Date: 2008-12-31 19:15:37
Message-ID: 618950b80812311115g3f35f045u7c4ad90b1e613afc@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Dear all,

I am using pl/pgsql to develop a function to implement some logic to load
BLOB data, like .tif file, to postgres DB. The issue I am facing is the file
name MUST be with double back-slash \\ in order for pgsql to process the
string properly. However, when the string is Escaped in my function, how can
I pass it in to lo_import() function?

Is there any function to double back-slash a string? Or how can we preserve
a string as RAW?

---- ISSUE :
-- use E'C:\\tmp\\tst.tif' for the full file name for IN parameter
of load_blob function.
-- however, when the string is escaped it becomes 'C:\tmp\tst.tif'
as expected
-- the file name need be passed in to lo_import() function again
without double \\
-- when it is passed in and escaped , the \ is gone and the filename
becomes meaningless

Any input would be much appreciated!

Thanks a lot
John

Browse pgsql-sql by date

  From Date Subject
Next Message Steve Midgley 2009-01-03 17:48:01 Re: Question on Escape-string
Previous Message Asko Oja 2008-12-31 12:34:46 Re: Object create date