Re: Why does pg_dump set default_with_oids to true?

Lists: pgsql-general
From: Kynn Jones <kynnjo(at)gmail(dot)com>
To: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Why does pg_dump set default_with_oids to true?
Date: 2009-10-26 15:04:23
Message-ID: c2350ba40910260804v633ac7f4h146a98756ab2d051@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

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


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Kynn Jones <kynnjo(at)gmail(dot)com>
Cc: 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 18:47:48
Message-ID: 1256582868.2389.6.camel@jd-desktop.unknown.charter.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

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


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Kynn Jones <kynnjo(at)gmail(dot)com>
Cc: 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 19:10:46
Message-ID: 20091026191046.GI8812@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

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.


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
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


From: Kynn Jones <kynnjo(at)gmail(dot)com>
To: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Why does pg_dump set default_with_oids to true?
Date: 2009-10-27 14:04:09
Message-ID: c2350ba40910270704q2a58c486lc5f797823941d041@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Thank you all.

Thanks again!

Kynn