pg_dump and vacuum fail on tables with no columns

From: "Michael D(dot) DeVore" <_mdevore_(at)virginia(dot)edu>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: pg_dump and vacuum fail on tables with no columns
Date: 2003-04-22 04:02:36
Message-ID: BACA371C.2C64%_mdevore_@virginia.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

It is possible to create a table with no columns:

create table mytemp ();

Not particularly useful, but students are prone do try things you wouldn't
otherwise expect. The problem is that the utility pg_dump will terminate
with an error when it encounters such a table (vacuum as well).

The error messages look like:

>From pg_dump:
-------------

pg_dump: SQL command to dump the contents of table "mytemp" failed
pg_dump: Error message from server: ERROR: parser: parse error at or near
")" at character 21
pg_dump: The command was: COPY public.mytemp () TO stdout;

>From vacuumdb:
--------------

ERROR: MemoryContextAlloc: invalid request size 0
vacuumdb: vacuum ekv2j failed

What's more, the pg_dumpall utility will terminate as well, leaving an
entire database cluster without being backed up.

>From pg_dumpall:
----------------

pg_dumpall: pg_dump failed on ekv2j, exiting

I observed these problems on PostgreSQL 7.3 on the Sun SPARC platform
running Solaris 9.

Whether or not pg_dump and pg_dumpall should terminate on an error is
debatable. However, I suggest that the errors generated by pg_dump and
vacuumdb should really be considered bugs since their failure prevents
important maintenance.

Michael
--
Michael D. DeVore Office: 102G Olsson Hall
Systems and Information Engineering e-mail: _mdevore_(at)virginia(dot)edu
(remove underscores)
University of Virginia Phone: (434) 924-4488
151 Engineer's Way Fax: (434) 982-2972
P.O. Box 400747
Charlottesville, VA 22904

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dave Jarvis 2003-04-22 05:51:13 Shift-Enter = Segmentation Fault
Previous Message Mig-O 2003-04-21 16:13:58 Re: Bug #951: Creating table fails if inherited table has no columns.