Re: Killing OIDs

Поиск
Список
Период
Сортировка
От Steve Crawford
Тема Re: Killing OIDs
Дата
Msg-id 4993149F.9060401@pinpointresearch.com
обсуждение исходный текст
Ответ на Re: Killing OIDs  ("Joshua D. Drake" <jd@commandprompt.com>)
Ответы Re: Killing OIDs  ("Daniel Verite" <daniel@manitou-mail.org>)
Список pgsql-general
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 OID removal on 7.4. I can get a script with:
>> SELECT
>>     'ALTER TABLE ' || relname || ' SET WITHOUT OIDS;'
>> FROM
>>     pg_class
>> WHERE
>>     relkind='r' and
>>     relowner != 1 and
>>     relhasoids;
>> .....
>>
>
> That won't drop the OID columns.
>

So what am I missing, here?:

steve=> create table foo (bar text);
CREATE TABLE
steve=> alter table foo drop column OID;
ERROR:  cannot drop system column "oid"
steve=> alter table foo set without OIDs;
ALTER TABLE
steve=> alter table foo drop column OID;
ERROR:  column "oid" of relation "foo" does not exist

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.

Cheers,
Steve


В списке pgsql-general по дате отправления:

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Killing OIDs
Следующее
От: "Ing. Eris Gomez"
Дата:
Сообщение: Saber cuando se dispara el trigger (After: insert,update,delete)