Re: Especial delimiters caracter

From: Christoph Haller <ch(at)rodos(dot)fzk(dot)de>
To: montervi(at)cabal(dot)com(dot)ar (Montervino, Mariano)
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Especial delimiters caracter
Date: 2003-09-30 13:42:54
Message-ID: 200309301142.NAA17746@rodos
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>
> Thanks for your replay...
> I resolve the problem with sed before i post the question.
> But a really want to know if i can handle all with posgre script.
>
> Mariano
>
No, you cannot. Because copy is also intended to work vice versa
i.e. copy from file to table and therefore the doubled backslash
is mandatory.

Regards, Christoph

>
> On Tuesday 23 September 2003 15:56, Montervino, Mariano wrote:
> > running the following script
> >
> > select ('cabal\\' || user_name) into temporary user_access from
> > tbl_user_access where access_profile_id =3D 4;
> > copy user_access to '/temp/users.txt' delimiters '|';
> >
> > The result of the output file is...
> > domain\\users
> > but the field in the temp table is...
> > domain\users
> >
> > I need the same result like temp table. How could i do it??
> > RGDS
>
> $ cat fakedump.txt
> C:\\Windows\\system32\\drivers|this\ttabbed\ttext\n
> $ perl -p -e 's/\\\\/\\/g;' fakedump.txt
> C:\Windows\system32\drivers|this\ttabbed\ttext\n
>
> As you can see, this only handles \\ not \t=3Dtab.
> You could also do this in sed:
> $ sed -e 's/\\\\/\\/g' fakedump.txt
>
> HTH
> --=20
> Richard Huxton

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Suresh Basandra 2003-09-30 17:17:42 Re: insert error
Previous Message Christoph Haller 2003-09-30 10:23:57 Re: Change of the datatype of a column