Skip site navigation (1) Skip section navigation (2)

Re: on line numbers, drop table errors, and log files

From: Jon Lapham <jlapham(at)gandalf(dot)bioqmed(dot)ufrj(dot)br>
To: Michael Richards <michael(at)fastmail(dot)ca>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: on line numbers, drop table errors, and log files
Date: 2000-08-02 13:02:33
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
On Tue, Aug 01, 2000 at 02:32:27PM -0400, Michael Richards wrote:
> I would consider running:
> pg_dump -D -u -c -f backup.dump
> This will dump the schema and drop the objects before creating them.
> -Michael
> > 4) I run pg_dump this way: "pg_dump -D -u -a -f backup.dump
> > main_v0_6" in order to create a backup of my "main_v0_6" database.
> >  In order to regenerate the database, I first run a "\i
> > create_tables.sql" script, then I run "\i backup.dump".  However,
> > I end up having to hand edit the "backup.dump" file to place "drop
> > sequence" statements before the "create sequence" statements
> > because they are created by my "create_tables.sql" script.  I'm
> > sure you Postgres gurus out there are not doing it this way, what
> > is your method of database backup/recovery?


	As I mentioned earlier, your solution worked great.  I am a bit
puzzled about the syntax that is created by my old method, using "pg_dump
-D -u -a".  I wonder why it creates "create sequence ..." commands instead
of "update sequence ..."?

	The reason I was originally using "-a" to begin with was that I
wanted to seperate the data entry from the table creation step.  So, the
idea was that I would have a nice hand editted script to make all my
tables, then the "-a" output of pg_dump would fill the database with data.

	As I said, your solution works, thanks, I'm just puzzled why my
way didn't.

	Later, Jon


 Jon Lapham
 Centro Nacional de Ressonancia Magnetica Nuclear de Macromoleculas
 Universidade Federal do Rio de Janeiro (UFRJ) - Brasil
 email: jlapham(at)gandalf(dot)bioqmed(dot)ufrj(dot)br  

In response to

pgsql-sql by date

Next:From: Itai ZukermanDate: 2000-08-02 13:41:52
Subject: Time Aggregates
Previous:From: Gerhard DieringerDate: 2000-08-02 07:32:40
Subject: Antw: SQL Question

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group