| From: | John R Pierce <pierce(at)hogranch(dot)com> |
|---|---|
| To: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: can a partition be loaded from file? |
| Date: | 2012-11-01 08:05:32 |
| Message-ID: | 50922D4C.9030606@hogranch.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On 11/01/12 12:48 AM, zhangbonian wrote:
> I have a question that if a partition can be loaded from a file?
> A table in the database is partitioned, and each partition is saved to
> a separate tablespace, so each located in a separate directory. We
> want to transfer the data in a specific partition (a directory with
> files in it) to a remote machine then load this partition to the db
> for processing. The remote DB has the same db schema to the local
> machine. and the data in this table doesn't depend on other tables.
> I'm not sure if it is workable. we can stop the database when doing
> backup (but not the database engine, Postgresql process) for data
> consistency.
> If it is not workable, does the COPY TO file function is the best
> solution for this situation?
no, that won't work, as there is a whole lot of metadata in the system
catalog that won't travel with that data, further, the OID's can be
different from system to system.
I would use: pg_dump -Fc -t partitionname -f dumpfile dbname
then restore this data on the other system with pg_restore ...
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Craig Ringer | 2012-11-01 08:56:20 | Re: Boolean type storage format |
| Previous Message | zhangbonian | 2012-11-01 07:48:29 | can a partition be loaded from file? |