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
Index: src/bin/pg_dump/pg_dump.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/bin/pg_dump/pg_dump.c,v
retrieving revision 1.291
diff -c -c -r1.291 pg_dump.c
*** src/bin/pg_dump/pg_dump.c 22 Aug 2002 21:35:50 -0000 1.291
--- src/bin/pg_dump/pg_dump.c 27 Aug 2002 20:33:50 -0000
***************
*** 467,472 ****
--- 467,478 ----
exit(1);
}
+ if (dataOnly && outputClean)
+ {
+ write_msg(NULL, "The options \"clean\" (-c) and \"data only\" (-a) cannot be used together.\n");
+ exit(1);
+ }
+
if (outputBlobs && selectTablename != NULL && strlen(selectTablename) > 0)
{
write_msg(NULL, "Large object output is not supported for a single table.\n");