Thread: import fixed width files into PostgreSQL

import fixed width files into PostgreSQL

From
"Johnson, Shaunn"
Date:

Howdy:

Running PostgreSQL 7.2.1 on RedHat Linux 7.2.

Is it possible to import, or otherwise '\copy', files into Pg tables
that are in a fixed width (no spaces) format?  If so, am I just
using copy or is there a method (example) for this somewhere?

Thanks!

-X

Re: import fixed width files into PostgreSQL

From
Doug McNaught
Date:
"Johnson, Shaunn" <SJohnson6@bcbsm.com> writes:

> Howdy:
>
> Running PostgreSQL 7.2.1 on RedHat Linux 7.2.
>
> Is it possible to import, or otherwise '\copy', files into Pg tables
> that are in a fixed width (no spaces) format?  If so, am I just
> using copy or is there a method (example) for this somewhere?

COPY requires delimiters; you'll have to massage it into delimited
form (or into INSERT statements) using a Perl script or whatever.

-Doug