Re: psql command line question..

From: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>
To: Christoph Dalitz <christoph(dot)dalitz(at)hs-niederrhein(dot)de>
Cc: tlw(at)att(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: psql command line question..
Date: 2003-01-29 17:00:58
Message-ID: 3E3808CA.8C3BD1BE@nsd.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Well, I am always amazed by the detour people will take...
Try:

tr '\011' ' '

Use tr for all character based translation.

By the way the TAB character is CTRL-I or x09 or 011 (octal) not x0B.

Christoph Dalitz wrote:
>
> > Date: Tue, 28 Jan 2003 23:53:49 -0500
> > From: "Williams, Travis L, NPONS" <tlw(at)att(dot)com>
> >
> > I have a bunch of huge inserts in a flat file.
> > They are in proper sql context and I can take each individual and copy/paste
> > it into psql and it inserts fine. I tried doing a psql -e dbname < file.sql
> > and I get errors. Is there anything specific I need to do to the file format?
> >
> I have observed very strange behaviour with psql when the input data contains
> TAB characters. Maybe that's your problem too.
>
> Replacing nonprintable characters with blanks is somewhat tricky, but possible
> with sed:
>
> # 0B is the hex code for TAB
> char2replace="`echo -e \x0B`"
> sed "s/$char2replace/ /g" ...
>
> Hope this helps,
>
> Christoph Dalitz
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Eric Cholet 2003-01-29 17:02:04 Re: index on timestamp performance
Previous Message Lincoln Yeoh 2003-01-29 17:00:27 Re: Firewalls and Postgres