Re: pg_restore - table restoration

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: "Day, David" <dday(at)redcom(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_restore - table restoration
Date: 2014-01-13 22:10:51
Message-ID: 52D4646B.6000403@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 01/13/2014 01:43 PM, Day, David wrote:
> Hi,
>
> This is sort of a continuation of = problems I was working on last week
>
> with selective restorations of an archive file at the schema or table
> level. ( V9.3)
>
> Given that I dumped the entire database ( pg_dump –Fc my_db –f
> archive_file )
>
> When I pg_restore an entire schema ( -n ) everything is wonderful.
>
> If I try to attempt two tables in one of the schemas I encounter problems.
>
> I get a success of sort with these option variations:
>
> pg_restore -c -t tbl1 –t tbl2 –U <username> -d my_db archive_file
>
> In this case the tables are recreated with data but all the original
> constraints for these tables are missing
>
> As are triggers that are associated with the tables. I guess I can
> understand this.

I just tried something similar here and I am not seeing that. I see
constraints and triggers.

Is there anything in the log that might help?

>
> Is this a bug or a mis-understanding on my part?

One thing you can do to help see what is going on is restore to a file
instead of the database. This creates a plain text file with the SQL
statements. So:

pg_restore -c -t tbl1 –t tbl2 –U <username> -f plain_text.sql
archive_file

>
> Regards
>
> Dave Day
>

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-01-14 00:35:47 Re: pg_restore - table restoration
Previous Message Day, David 2014-01-13 21:43:30 pg_restore - table restoration