From: | Terry Lee Tucker <terry(at)esc1(dot)com> |
---|---|
To: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Can COPY skip columns? |
Date: | 2004-11-18 22:14:46 |
Message-ID: | 200411181714.46067.terry@esc1.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Another thing you can do if you know how to use Perl is to write a load
procedure for the ascii file. We are dumping data from a Progress database so
there was quite a lot of massaging to do, especially with some tables. We
read the Progress dump in and write it back out in the format we need for
PostgreSQL. Then we use COPY. Perl is excellent for this typ of work.
On Thursday 18 November 2004 12:15 pm, Tom Lane saith:
> Adam Witney <awitney(at)sghms(dot)ac(dot)uk> writes:
> > Is it possible for the COPY command to read data from a file, but skip
> > specific columns?
>
> Nope. When you get into significant massaging of the input data,
> usually the best bet is to COPY into a temp table that exactly matches
> the format of the data file, and then do your rearrangements using an
> INSERT/SELECT into the final target table.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
> joining column's datatypes do not match
--
Work: 1-336-372-6812
Cell: 1-336-363-4719
email: terry(at)esc1(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Terry Lee Tucker | 2004-11-18 22:25:22 | Re: only seeing first of many COPY commands in input file |
Previous Message | Mike Richards | 2004-11-18 21:50:42 | Re: A couple serious errors |