Fix for dumoing WITH/WITHOUT oids

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Fix for dumoing WITH/WITHOUT oids
Date: 2004-03-23 20:02:21
Message-ID: 200403232002.i2NK2Mr18107@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

The attached patch prevents WITH/WITHOUT OIDS from appearing in pg_dump
output. Instead, it uses "SET default_with_oids" to control oid
creation, but only outputs it when the table characteristics change, not
for every table.

The patch basically add a withOids field to the table of contents
(TocEntry). TocEntries are part of our binary dumps. I updated the
pg_dump version number. The code conditinally reads the TocEntry and
reads this field if the version is as new as the new 1.9 version.

The patch adds a new ArchiveHandle.currWithOids to track the current
backend default_with_oids setting. This boolean variable is set to -1
on new connection so it will trigger a SET when first used.

The majority of the patch is adding withOids to all the ArchiveEntry
calls, even though it is only used for the TABLE tag.

I have tested this patch in both binary and ASCII outputs. Binary gets
the OID setting from the TocEntry, while ASCII keeps track of the OID
setting.

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

Attachment Content-Type Size
unknown_filename text/plain 26.3 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Magnus Hagander 2004-03-23 20:47:56 Re: Patch for select and APC on win32
Previous Message Andrew Dunstan 2004-03-23 19:53:06 dollar quoting and pg_dump