Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group