Bug #743: pg_dump -a -c without DELETE FROM

Started by PostgreSQL Bugs Listover 23 years ago6 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

Przemyslaw Sztoch (psztoch@interia.pl) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
pg_dump -a -c without DELETE FROM

Long Description
In my opinion "pg_dump -a -c" should generate "DELETE FROM <table>" before COPY statement.
Options:
-a, --data-only dump only the data, not the schema
-c, --clean clean (drop) schema prior to create
TIA for answer or your opinions.

Sample Code

No file was uploaded with this report

#2Philip Warner
pjw@rhyme.com.au
In reply to: PostgreSQL Bugs List (#1)
Re: Bug #743: pg_dump -a -c without DELETE FROM

At 10:40 22/08/2002 -0400, pgsql-bugs@postgresql.org wrote:

-c, --clean clean (drop) schema prior to create

Given that it is dropping the table, it does not really need to do a delete.

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

#3Przemysław Sztoch
psztoch@interia.pl
In reply to: Philip Warner (#2)
Re: Bug #743: pg_dump -a -c without DELETE FROM

Witam Philip Warner!

22 sierpnia 2002, 16:49:47, zosta�o napisane:

-c, --clean clean (drop) schema prior to create

PW> Given that it is dropping the table, it does not really need to do a delete.
---
Ok. But I am talking about "pg_dump -a -c", not about "pg_dump -c".
When I am unloading data only, I can't drop my table!

---
Przemys�aw Sztoch, LTC Sp. z o.o.
psztoch@finn.pl, http://www.finn.pl, +48 (42) 684-98-91

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Philip Warner (#2)
Re: Bug #743: pg_dump -a -c without DELETE FROM

Philip Warner <pjw@rhyme.com.au> writes:

Given that it is dropping the table, it does not really need to do a delete.

But with -a it won't do the drop (I hope).

The combination -a -c seems rather useless to me, and I'd vote for
throwing an error. I don't think emitting DELETE FROM would be very
useful in practice (at least not without a VACUUM) so I'm not in
favor of that.

regards, tom lane

#5Bruce Momjian
bruce@momjian.us
In reply to: PostgreSQL Bugs List (#1)
Re: Bug #743: pg_dump -a -c without DELETE FROM

The following patch disables use of -a and -c together. This will
appear in the next release.

---------------------------------------------------------------------------

pgsql-bugs@postgresql.org wrote:

Przemyslaw Sztoch (psztoch@interia.pl) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
pg_dump -a -c without DELETE FROM

Long Description
In my opinion "pg_dump -a -c" should generate "DELETE FROM <table>" before COPY statement.
Options:
-a, --data-only dump only the data, not the schema
-c, --clean clean (drop) schema prior to create
TIA for answer or your opinions.

Sample Code

No file was uploaded with this report

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Attachments:

/bjm/difftext/plainDownload+6-0
#6Bruce Momjian
bruce@momjian.us
In reply to: Przemysław Sztoch (#3)
Re: Bug #743: pg_dump -a -c without DELETE FROM

Witam Philip Warner!

22 sierpnia 2002, 16:49:47, zosta���o napisane:

-c, --clean clean (drop) schema prior to create

PW> Given that it is dropping the table, it does not really need to do a delete.
---
Ok. But I am talking about "pg_dump -a -c", not about "pg_dump -c".
When I am unloading data only, I can't drop my table!

Well, the -a -c options only control what happens when the data is
reloaded. It doesn't do anything to the database it is dumping.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073