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

From: "Michael Richards" <michael(at)fastmail(dot)ca>
To: pgsql-sql(at)postgresql(dot)org
Cc: jlapham(at)gandalf(dot)bioqmed(dot)ufrj(dot)br
Subject: Re: on line numbers, drop table errors, and log files
Date: 2000-08-01 18:32:27
Message-ID: 398717BB.00003D.01145@frodo.searchcanada.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 most quotes 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 use password 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Daryl Herzmann 2000-08-01 20:38:13 SQL Question
Previous Message Roberto Mello 2000-08-01 17:43:10 PL/Tcl