Re: SOLVED - pg_restore question

From: "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>
To: 'Andrew Sullivan' <andrew(at)libertyrms(dot)info>, "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: SOLVED - pg_restore question
Date: 2002-05-06 19:22:48
Message-ID: 73309C2FDD95D11192E60008C7B1D5BB0452E3A6@snt452.corp.bcbsm.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

--Thanks. I remembered that I did something like
this a bit ago, but for some reason thought that
pg_restore was the way to go. Yeah, I finally
used psql -d <database> -f ./<pg_dump file>. Everything
else is embedded in the SQL script.

--Looks like it created all of the things I
needed. I don't recall the docs saying
anything about when using pg_dump, use the -Ct
option or you won't be able to use pg_restore ... or
maybe I missed that part. At least, it doesn't
appear to be very obvious as to how to recreate the table
without destroying the database using pg_restore.

--Anyhow, thanks!

-X

-----Original Message-----
From: Andrew Sullivan [mailto:andrew(at)libertyrms(dot)info]
Sent: Monday, May 06, 2002 3:05 PM
To: Johnson, Shaunn
Subject: Re: [GENERAL] pg_restore question

On Mon, May 06, 2002 at 12:48:34PM -0400, Johnson, Shaunn wrote:
> Running Postgres 7.1.3 on RedHat Linux 7.2.
>
> I'm looking for examples of using pg_restore.

Don't bother. You created an ASCII file. The only reason to use
pg_restore is if you've created a non-ASCII dump.

> pg_dump -u -t table_name database | /bin/gzip > table_name.gz

gunzip -c table_name.gz | psql database

Note that you didn't tell pg_dump to clean the database, so it won't drop
the table before creating. So make sure you've done that
yourself.

A
--
----
Andrew Sullivan 87 Mowat Avenue
Liberty RMS Toronto, Ontario Canada
<andrew(at)libertyrms(dot)info> M6K 3E3
+1 416 646 3304 x110

Browse pgsql-general by date

  From Date Subject
Next Message frank_lupo@email.it 2002-05-06 19:33:29 count problem
Previous Message Steve Lane 2002-05-06 19:16:35 Re: Subject: bool / vacuum full bug followup part 2