Re: [GENERAL] Killing OIDs

2009-02-12 Thread Scott Marlowe
On Thu, Feb 12, 2009 at 10:02 AM, Steve Crawford wrote: > Scott Marlowe wrote: >> >>> Close. It actually does a "SET default_with_oids = true;" (or false) >>> prior >>> to the CREATE TABLE statement. In any case, it does preserve the OID >>> setting >>> of the source database. >>> >> >> So, I'd th

Re: [GENERAL] Killing OIDs

2009-02-12 Thread Steve Crawford
Scott Marlowe wrote: Close. It actually does a "SET default_with_oids = true;" (or false) prior to the CREATE TABLE statement. In any case, it does preserve the OID setting of the source database. So, I'd think it would be easier to just edit the backup than to muck around in the 7.4 dat

Re: [GENERAL] Killing OIDs

2009-02-11 Thread Scott Marlowe
On Wed, Feb 11, 2009 at 12:59 PM, Steve Crawford wrote: > Raymond O'Donnell wrote: >> >> >>> >>> Since 8.3 creates tables WITHOUT OIDS by default, I'd think just >>> dumping from 7.4 to 8.3 with 8.3's pg_dump should do the trick. Or am >>> I missing something? >>> >> >> I could be wrong, but I th

Re: [GENERAL] Killing OIDs

2009-02-11 Thread Steve Crawford
Daniel Verite wrote: I seems to me that pg_dump does it for you anyway, unless you ask otherwise. See the -o option. No, as I understand it this does not influence whether or not the table is recreated with OIDs, it determines whether the _values_ of the OIDs are included in the dumped data.

Re: [GENERAL] Killing OIDs

2009-02-11 Thread Daniel Verite
Steve Crawford wrote: Although I assume a cluster would reclaim space, I don't actually care if the space used by the OIDs is reclaimed in the 7.4 database as long as the OIDs are not created when the data is restored in 8.3. I seems to me that pg_dump does it for you anyway, unles

Re: [GENERAL] Killing OIDs

2009-02-11 Thread Steve Crawford
Raymond O'Donnell wrote: Since 8.3 creates tables WITHOUT OIDS by default, I'd think just dumping from 7.4 to 8.3 with 8.3's pg_dump should do the trick. Or am I missing something? I could be wrong, but I think 8.3's pg_dump will append WITH (OIDS=TRUE) if it finds tables with OIDs.

Re: [GENERAL] Killing OIDs

2009-02-11 Thread Raymond O'Donnell
On 11/02/2009 19:40, Scott Marlowe wrote: > Since 8.3 creates tables WITHOUT OIDS by default, I'd think just > dumping from 7.4 to 8.3 with 8.3's pg_dump should do the trick. Or am > I missing something? I could be wrong, but I think 8.3's pg_dump will append WITH (OIDS=TRUE) if it finds tables

Re: [GENERAL] Killing OIDs

2009-02-11 Thread Scott Marlowe
On Wed, Feb 11, 2009 at 10:41 AM, Steve Crawford wrote: > I'm about to deal with an upgrade of a server running 7.4. I have checked > with the developers and they are not using OIDs so I'd like to remove them > so they aren't carried forward to 8.3. > > My plan is to do the OID removal on 7.4. I c

Re: [GENERAL] Killing OIDs

2009-02-11 Thread Tom Lane
I wrote: > Sure it will. I'd be a little worried about whether he shouldn't > be using quote_identifier and/or schema-qualifying the names, but > SET WITHOUT OIDS is the right command to be issuing. BTW, the lazy man's way to deal with both of those issues is to cast the OID to regclass, ie the b

Re: [GENERAL] Killing OIDs

2009-02-11 Thread Steve Crawford
Tom Lane wrote: ... I'd be a little worried about whether he shouldn't be using quote_identifier and/or schema-qualifying the names, but SET WITHOUT OIDS is the right command to be issuing. It may not make any difference in this case, but for completeness and correctness: SELECT 'ALTER T

Re: [GENERAL] Killing OIDs

2009-02-11 Thread Steve Crawford
Joshua D. Drake wrote: On Wed, 2009-02-11 at 09:41 -0800, Steve Crawford wrote: I'm about to deal with an upgrade of a server running 7.4. I have checked with the developers and they are not using OIDs so I'd like to remove them so they aren't carried forward to 8.3. My plan is to do the O

Re: [GENERAL] Killing OIDs

2009-02-11 Thread Tom Lane
"Joshua D. Drake" writes: > On Wed, 2009-02-11 at 09:41 -0800, Steve Crawford wrote: >> My plan is to do the OID removal on 7.4. I can get a script with: >> SELECT >> 'ALTER TABLE ' || relname || ' SET WITHOUT OIDS;' > That won't drop the OID columns. Sure it will. I'd be a little worried about

Re: [GENERAL] Killing OIDs

2009-02-11 Thread Joshua D. Drake
On Wed, 2009-02-11 at 18:01 +, Adrian Klaver wrote: > - "Joshua D. Drake" wrote: > Now I am confused. From the docs I get: > My bad. The docs are obviously correct. I think I was thinking about the postgresql.conf option. Joshua D. Drae > SET WITHOUT OIDS > > This form removes t

Re: [GENERAL] Killing OIDs

2009-02-11 Thread Adrian Klaver
- "Joshua D. Drake" wrote: > On Wed, 2009-02-11 at 09:41 -0800, Steve Crawford wrote: > > I'm about to deal with an upgrade of a server running 7.4. I have > > checked with the developers and they are not using OIDs so I'd like > to > > remove them so they aren't carried forward to 8.3. > >

Re: [GENERAL] Killing OIDs

2009-02-11 Thread Joshua D. Drake
On Wed, 2009-02-11 at 09:41 -0800, Steve Crawford wrote: > I'm about to deal with an upgrade of a server running 7.4. I have > checked with the developers and they are not using OIDs so I'd like to > remove them so they aren't carried forward to 8.3. > > My plan is to do the OID removal on 7.4.