Re: OID wraparound: summary and proposal
От | mlw |
---|---|
Тема | Re: OID wraparound: summary and proposal |
Дата | |
Msg-id | 3B6A9D69.48C09C57@mohawksoft.com обсуждение исходный текст |
Ответ на | OID wraparound: summary and proposal (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
Tom Lane wrote: > [Snipped] I think making "WITHOUT OIDS" the default for table creation is the right thing to do. Here is my reasoning: An OID is a system wide limitation. 4B or 2B depending on sign-ness. (could there be some bugs still lurking on high OIDs?) Since the OID is a shared system wide limited resource, it should be limited to "system" tables which require it. To new comers to PostgreSQL this limitation will not be obvious until they hit it. Then they will kick themselves for not reading more carefully. An OID does not add any real value to the database developer. Given an OID, one can not determine anything about the record it represents. One also needs the table and database from which it came, and even then one has to create an index on the OID column on the table to get to the record efficiently. It can only indicate the order in which records were entered. If people need something like OID for their tables, the documented "preferred way" could be: create sequence fubar; create table fubar (rowid integer default nextval('fubar_seq'),... ); Then explain that they can use "WITH OID" but there is a system wide limit. On a side note: I know it is probably a lot of work, and it has been shot down once, but the notion of a rowid built into a table would be useful. It would solve wrap around and keep the useful functionality of OID, and be more efficient and robust than using the sequence.
В списке pgsql-hackers по дате отправления: