Re: on line numbers, drop table errors, and log files - Mailing list pgsql-sql

From Michael Richards
Subject Re: on line numbers, drop table errors, and log files
Date
Msg-id 398717BB.00003D.01145@frodo.searchcanada.ca
Whole thread Raw
In response to on line numbers, drop table errors, and log files  (Jon Lapham <jlapham@gandalf.bioqmed.ufrj.br>)
Responses Re: on line numbers, drop table errors, and log files  (Jon Lapham <jlapham@gandalf.bioqmed.ufrj.br>)
List pgsql-sql
Hi.

Here are the options for pg_dump: -a         dump out only the data, no schema -c         clean (drop) schema prior to
create-d         dump data as INSERT, rather than COPY, commands -D         dump data as INSERT commands with attribute
names-h <hostname>   server host name -i         proceed when database version != pg_dump version -n         suppress
mostquotes around identifiers -N         enable most quotes around identifiers -o         dump object ids (oids) -p
<port> server port number -s         dump out only the schema, no data -t <table> dump for this table only -u
usepassword authentication -v         verbose -x         do not dump ACL's (grant/revoke)
 

So you are dumping it with the following:
Proper INSERT commands/attribs, pwd auth, data only

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?

_________________________________________________________________    http://fastmail.ca/ - Fast Free Web Email for
Canadians

pgsql-sql by date:

Previous
From: Roberto Mello
Date:
Subject: PL/Tcl
Next
From: Daryl Herzmann
Date:
Subject: SQL Question