Why does pg_dump set default_with_oids to true?

Started by Kynn Jonesover 16 years ago5 messagesgeneral
Jump to latest
#1Kynn Jones
kynnjo@gmail.com

I've noticed that the dumps generated by pg_dump set the parameter
default_with_oids to true in various places (separated by setting it back to
false in-between).

This happens even for databases whose creation and maintenance did not
involve any explicit setting of this parameter.

The documentation deprecates setting this variable to true. Why does
pg_dump do it?

TIA!

Kynn

#2Joshua D. Drake
jd@commandprompt.com
In reply to: Kynn Jones (#1)
Re: Why does pg_dump set default_with_oids to true?

On Mon, 2009-10-26 at 11:04 -0400, Kynn Jones wrote:

I've noticed that the dumps generated by pg_dump set the parameter
default_with_oids to true in various places (separated by setting it
back to false in-between).

This happens even for databases whose creation and maintenance did not
involve any explicit setting of this parameter.

The documentation deprecates setting this variable to true. Why does
pg_dump do it?

It is picking up objects that have OIDS.

Joshua D. Drake

TIA!

Kynn

--
PostgreSQL.org Major Contributor
Command Prompt, Inc: http://www.commandprompt.com/ - 503.667.4564
Consulting, Training, Support, Custom Development, Engineering
If the world pushes look it in the eye and GRR. Then push back harder. - Salamander

#3Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Kynn Jones (#1)
Re: Why does pg_dump set default_with_oids to true?

Kynn Jones escribi�:

I've noticed that the dumps generated by pg_dump set the parameter
default_with_oids to true in various places (separated by setting it back to
false in-between).

This happens even for databases whose creation and maintenance did not
involve any explicit setting of this parameter.

The documentation deprecates setting this variable to true. Why does
pg_dump do it?

To dump tables that were created WITH OIDS.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#3)
Re: Why does pg_dump set default_with_oids to true?

Alvaro Herrera <alvherre@commandprompt.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

#5Kynn Jones
kynnjo@gmail.com
In reply to: Tom Lane (#4)
Re: Why does pg_dump set default_with_oids to true?

Thank you all.

Thanks again!

Kynn