Обсуждение: Why does pg_dump set default_with_oids to true?
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
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
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.
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
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
Thank you all.
Thanks again!
Kynn
Thanks again!
Kynn