Re: psql command line question.. - Mailing list pgsql-general

From Christoph Dalitz
Subject Re: psql command line question..
Date
Msg-id 20030129101940.6da5885b.christoph.dalitz@hs-niederrhein.de
Whole thread Raw
In response to psql command line question..  ("Williams, Travis L, NPONS" <tlw@att.com>)
List pgsql-general
> Date: Tue, 28 Jan 2003 23:53:49 -0500
> From: "Williams, Travis L, NPONS" <tlw@att.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

pgsql-general by date:

Previous
From: Johann Uhrmann
Date:
Subject: Re: Getting results from a dynamic query in PL/pgSQL
Next
From: "Rick Gigger"
Date:
Subject: Re: Using RSYNC for replication?