Re: Why does pg_dump set default_with_oids to true?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Kynn Jones <kynnjo(at)gmail(dot)com>, pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Why does pg_dump set default_with_oids to true?
Date: 2009-10-26 20:11:56
Message-ID: 15045.1256587916@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Kynn Jones escribi:
>> The documentation deprecates setting this variable to true. Why does
>> pg_dump do it?

> To dump tables that were created WITH OIDS.

What is deprecated is the use of the WITH OIDS feature, not the variable
;-). But it is not pg_dump's charter to enforce that deprecation.

Maybe what you are asking is why it uses SET default_with_oids rather
than attaching WITH OIDS to the CREATE TABLE commands. That was done
as a compatibility measure so that the dump files would still be
readable by PG versions that didn't understand WITH OIDS --- they'd
reject the SET commands but still accept the CREATE TABLE commands.
By the same token the files are a shade more portable to other DBMSes
than they would be with WITH OIDS clauses. Neither of these arguments
is hugely compelling, perhaps, but avoiding the use of a variable isn't
very compelling either ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dave Page 2009-10-26 20:15:50 Re: [ANNOUNCE] PGDay.EU 2009 - approaching fast!
Previous Message John R Pierce 2009-10-26 20:09:20 Re: Logging statements with errors in PostgreSQL 8.1