Creating a zero-column table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Creating a zero-column table
Date: 2002-12-12 21:08:06
Message-ID: 5291.1039727286@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I was bemused to notice that pg_dump is currently unable to dump the
regression database. The domain regression test leaves an empty table
(one with zero columns), which causes pg_dump to produce

--
-- TOC entry 172 (OID 675837)
-- Name: domnotnull; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE domnotnull (
);

This is rejected on restore:

ERROR: DefineRelation: please inherit from a relation or define an attribute

I believe that the table would be correctly restored if we simply
removed that error check in DefineRelation. On the other hand, for
ordinary hand-entered CREATE TABLE commands it seems like a useful
error check.

Should we remove this error check, thereby effectively making
zero-column tables first-class citizens? If not, what shall we say to
people who complain that their dump is broken?

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-12-12 21:12:36 Re: PQnotifies() in 7.3 broken?
Previous Message Bruce Momjian 2002-12-12 21:03:09 Re: show casts and conversions in psql (2nd try)