| From: | Shelby Cain <alyandon(at)yahoo(dot)com> | 
|---|---|
| To: | Patrick(dot)FICHE(at)AQSACOM(dot)COM, pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: Change Windows path to Unix path... | 
| Date: | 2005-04-26 15:52:05 | 
| Message-ID: | 20050426155206.509.qmail@web50107.mail.yahoo.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
--- Patrick(dot)FICHE(at)AQSACOM(dot)COM wrote:
> Hi,
>  
> I'm trying to execute COPY command from some pgsql
> function.
> The filename is given as an argument of the
> function.
> But I get the filename like 'F:\tmp\file.txt' and I
> need to change this to
> 'F:/tmp/file.txt' before applying the COPY command.
>  
> I dind't succeed to replace '\' by '/' in the
> filename. 
Did you escape the backslash?  Postgresql interprets
that as a C-style escape sequence.
Try something like:
create function win32tounix(varchar) returns varchar
as $$
  select replace($1, '\\', '/');
$$ language sql;
__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Ned Lilly | 2005-04-26 16:41:25 | Re: OpenRPT | 
| Previous Message | Patrick.FICHE | 2005-04-26 15:29:59 | Change Windows path to Unix path... |