pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedRe: Especial delimiters caracter
5+ messages / 3 participants
[nested] [flat]
* Especial delimiters caracter
@ 2003-09-23 14:56 Montervino, Mariano <montervi@cabal.com.ar>
2003-09-24 17:18 ` Re: Especial delimiters caracter Richard Huxton <dev@archonet.com>
0 siblings, 1 reply; 5+ messages in thread
From: Montervino, Mariano @ 2003-09-23 14:56 UTC (permalink / raw)
To: pgsql-sql
running the following script
select ('cabal\\' || user_name) into temporary user_access from
tbl_user_access where access_profile_id = 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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Especial delimiters caracter
2003-09-23 14:56 Especial delimiters caracter Montervino, Mariano <montervi@cabal.com.ar>
@ 2003-09-24 17:18 ` Richard Huxton <dev@archonet.com>
0 siblings, 0 replies; 5+ messages in thread
From: Richard Huxton @ 2003-09-24 17:18 UTC (permalink / raw)
To: Montervino, Mariano <montervi@cabal.com.ar>; pgsql-sql
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 = 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=tab.
You could also do this in sed:
$ sed -e 's/\\\\/\\/g' fakedump.txt
HTH
--
Richard Huxton
Archonet Ltd
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Especial delimiters caracter
@ 2003-09-24 17:27 Montervino, Mariano <montervi@cabal.com.ar>
1970-01-01 00:00 ` Re: Especial delimiters caracter Christoph Haller <ch@rodos.fzk.de>
2003-09-24 19:36 ` Re: Especial delimiters caracter Richard Huxton <dev@archonet.com>
0 siblings, 2 replies; 5+ messages in thread
From: Montervino, Mariano @ 2003-09-24 17:27 UTC (permalink / raw)
To: Richard Huxton <dev@archonet.com>; 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
-----Mensaje original-----
De: Richard Huxton [mailto:dev@archonet.com]
Enviado el: MiƩrcoles, 24 de Septiembre de 2003 14:19
Para: Montervino, Mariano; 'pgsql-sql@postgresql.org'
Asunto: Re: [SQL] Especial delimiters caracter
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 = 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=tab.
You could also do this in sed:
$ sed -e 's/\\\\/\\/g' fakedump.txt
HTH
--
Richard Huxton
Archonet Ltd
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Especial delimiters caracter
2003-09-24 17:27 Re: Especial delimiters caracter Montervino, Mariano <montervi@cabal.com.ar>
@ 1970-01-01 00:00 ` Christoph Haller <ch@rodos.fzk.de>
1 sibling, 0 replies; 5+ messages in thread
From: Christoph Haller @ 1970-01-01 00:00 UTC (permalink / raw)
To: montervi@cabal.com.ar; +Cc: 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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Especial delimiters caracter
2003-09-24 17:27 Re: Especial delimiters caracter Montervino, Mariano <montervi@cabal.com.ar>
@ 2003-09-24 19:36 ` Richard Huxton <dev@archonet.com>
1 sibling, 0 replies; 5+ messages in thread
From: Richard Huxton @ 2003-09-24 19:36 UTC (permalink / raw)
To: Montervino, Mariano <montervi@cabal.com.ar>; pgsql-sql
On Wednesday 24 September 2003 18:27, Montervino, Mariano wrote:
> 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.
Not really - it's designed that way so you can COPY TO a file on one machine
and then COPY FROM on another.
--
Richard Huxton
Archonet Ltd
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2003-09-24 19:36 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-09-23 14:56 Especial delimiters caracter Montervino, Mariano <montervi@cabal.com.ar>
2003-09-24 17:18 ` Richard Huxton <dev@archonet.com>
2003-09-24 17:27 Re: Especial delimiters caracter Montervino, Mariano <montervi@cabal.com.ar>
1970-01-01 00:00 ` Christoph Haller <ch@rodos.fzk.de>
2003-09-24 19:36 ` Richard Huxton <dev@archonet.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox