# Rails with postgres-oids?

**URL:** <https://www.ruby-forum.com/t/rails-with-postgres-oids/71838>\
**Category:** Rails\
**Created:** [February 22, 2006, 3:09pm UTC](https://www.ruby-forum.com/t/rails-with-postgres-oids/71838 "2006-02-22T15:09:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Philipp\_Ott](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/8e8cbc/32.png) [@Philipp\_Ott](https://www.ruby-forum.com/u/Philipp_Ott)\
**Post date:** [February 22, 2006, 3:09pm UTC](https://www.ruby-forum.com/t/rails-with-postgres-oids/71838/1 "2006-02-22T15:09:16Z")

</div>

Hello!

Postgres supports oids which is a unique number for any row in a given  
database. There is the ‘id’ already inside oids - wouldnt it be nice and  
handy to turn on some global environemt.rb or database.yaml magic-switch  
and rails uses the oids internally and transparently on the postgresql  
adapter, sparing people the need to create auto-increment-serial ids  
with postgres databases?

Regards  
Philipp

---

<div class="post-metadata">

**Author:** ![Philipp\_Ott](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/8e8cbc/32.png) [@Philipp\_Ott](https://www.ruby-forum.com/u/Philipp_Ott)\
**Post date:** [February 22, 2006, 3:12pm UTC](https://www.ruby-forum.com/t/rails-with-postgres-oids/71838/2 "2006-02-22T15:12:34Z")

</div>

row OIDs work best only for internals - pg\_catalog tables, for example.  
don’t use them as primary keys for your tables - it’s ugly and is  
discouraged.  
(and recent versions of PostgreSQL have WITHOUT OIDS as _default_  
option for CREATE TABLE)
