database - SQL, Postgres OIDs, What are they and why are they useful? -


i looking @ postgresql table creation , stumbled upon this:

create table ( ... ) ( oids = false ); 

i read documentation provided postgres , know concept of object identifier oop still not grasp,

  • why such identifier useful in database?
  • to make queries shorter?
  • when should used?

oids give built-in, globally unique id every row, contained in system column (as opposed user-space column). that's handy tables don't have primary key, have duplicate rows, etc. example, if have table 2 identical rows, , want delete oldest of two, using oid column.

in experience, feature unused in postgres-backed applications (probably in part because they're non-standard), , their use deprecated:

in postgresql 8.1 default_with_oids off default; in prior versions of postgresql, on default.

the use of oids in user tables considered deprecated, installations should leave variable disabled. applications require oids particular table should specify oids when creating table. variable can enabled compatibility old applications not follow behavior.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -