From: | Douglas McNaught <doug(at)mcnaught(dot)org> |
---|---|
To: | rasdj(at)frontiernet(dot)net |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Multiple COPYs |
Date: | 2005-06-17 14:30:09 |
Message-ID: | m2wtotukcu.fsf@Douglas-McNaughts-Powerbook.local |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
rasdj(at)frontiernet(dot)net writes:
> Hello,
>
> Having a great time with PG - ported an erp from oracle and db2. First
> I tried MySql but choked somewhere in the 900 table region. I have a
> python script to translate the syntax and it loads about 2000 tables.
>
> Now I want to COPY my dumps - I have 1 data dump for each table. Any
> tips on what to use so that I can read the file name into a variable
> and pass it as the file name in the COPY command and have one script
> load all my tables?
Should be pretty easy from the shell, something like (untested):
for f in *.sql; do
tablename=`basename $f .sql`
psql -c "\\copy $tablename from $f" mydatabase
done
-Doug
From | Date | Subject | |
---|---|---|---|
Next Message | Sean Davis | 2005-06-17 14:32:52 | Re: Multiple COPYs |
Previous Message | Douglas McNaught | 2005-06-17 14:23:42 | Re: Help: chinese character set support (EUC_TW to/from BIG5 conversion) |