Re: COPY

From: Alvaro Herrera <alvherre(at)atentus(dot)com>
To: igor <linux_211(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: COPY
Date: 2002-08-06 23:42:49
Message-ID: Pine.LNX.4.44.0208061940020.14079-100000@cm-lcon1-46-187.cm.vtr.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

igor dijo:

> I am using the copy command for copy very large database. But I am
> using it like it's described in tutorial "copy table from
> '/file'..etc". So it takes a lot of time copy each table. Is there any
> way how to create some function to copy all the directory ,or
> something like foreach (table)...? That directory would contain
> prepared tables already. I do not know lot about PostgreSQL functions
> ,so I am asking some advice.

It should be very simple to write on in Perl or shell to do that,
something like

for i in /where/dumps/reside/*.dump; do
psql -c "copy table from $i" && mv $i $i.old
done

--
Alvaro Herrera (<alvherre[a]atentus.com>)
La web junta la gente porque no importa que clase de mutante sexual seas,
tienes millones de posibles parejas. Pon "buscar gente que tengan sexo con
ciervos incendiánse", y el computador dirá "especifique el tipo de ciervo"
(Jason Alexander)

In response to

  • COPY at 2002-08-05 15:38:52 from igor

Browse pgsql-general by date

  From Date Subject
Next Message Joel Joseph 2002-08-07 02:26:45 working with arrays question
Previous Message Markus Wollny 2002-08-06 22:15:09 Re: URGENT: Database keeps crashing - suspect damagedRAM