From: Scott Whitney <scott@journyx.com>
To: dbhandary@iii.com
Cc: pgsql-admin@postgresql.org
Subject: Re: restore
Date: Tue, 5 Oct 2010 13:19:28 -0500 (CDT)
Message-ID: <15942922.53164.1286302768223.JavaMail.root@zimbra.int.journyx.com> (raw)
In-Reply-To: <2974621.53161.1286302677914.JavaMail.root@zimbra.int.journyx.com>
There are a couple of ways. Assuming that it's the same database, and it's up and running, you could do this:
Assuming:
table foo (col1 text, col2 int);
table bar (col2 text, col3 int);
insert into bar (select * from foo);
would stick everything from foo.col1 and foo.col2 into bar.col2 and bar.col3 respectively.
Using pg_dump, you could dump just the table:
pg_dump -t foo mydatabase
and edit the CREATE TABLE statement.
Hi All,
Is there an easy way to restore to a new table where the column name
have been changed but data remains the same?
For example I am trying to restore from existing system, table1(col1)
to table1(col2) and it is erroring out on the new column name even
though it is a data only restore. I was just wondering if there is a
quick way to bypass this. Let me know.
Thanks.
Dinesh
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: scott@journyx.com, dbhandary@iii.com
Subject: Re: restore
In-Reply-To: <15942922.53164.1286302768223.JavaMail.root@zimbra.int.journyx.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox