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: (view raw, whole thread or download thread mbox)
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

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-2017 The PostgreSQL Global Development Group