Re: ALTER TABLE .. < ADD | DROP > OIDS
От | Bruce Momjian |
---|---|
Тема | Re: ALTER TABLE .. < ADD | DROP > OIDS |
Дата | |
Msg-id | 200212060500.gB650El12702@candle.pha.pa.us обсуждение исходный текст |
Ответ на | ALTER TABLE .. < ADD | DROP > OIDS (Rod Taylor <rbt@rbt.ca>) |
Ответы |
Re: ALTER TABLE .. < ADD | DROP > OIDS
|
Список | pgsql-performance |
OK, patch applied and tested. --------------------------------------------------------------------------- Rod Taylor wrote: -- Start of PGP signed section. > I wish to create an alter command which will allow a table to have OIDs > added or removed. > > > The tricky part appears to be changing the tuples themselves. I believe > if I pull the same trick that cluster does (create new file, copy > tuples, etc) it can be done fairly easily. > > First, set up pg_class appropriately (oid flag). > > Second, copy out tuples from oldfile to newfile, running a > heap_deformtuple() -> heap_formtuple() process on each. Since > heap_deformtuple only deals with positive numbered attributes > (non-system attributes) this should be safe to do on a mis-configured > relation. heap_formtuple completes the dirty work of setting up the OID > column appropriately. > > -- > Rod Taylor <rbt@rbt.ca> > > PGP Key: http://www.rbt.ca/rbtpub.asc -- End of PGP section, PGP failed! -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
В списке pgsql-performance по дате отправления: