1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
5 >Object Identifier Types</TITLE
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
10 HREF="mailto:pgsql-docs@postgresql.org"><LINK
12 TITLE="PostgreSQL 7.4.1 Documentation"
13 HREF="index.html"><LINK
16 HREF="datatype.html"><LINK
19 HREF="arrays.html"><LINK
22 HREF="datatype-pseudo.html"><LINK
25 HREF="stylesheet.css"><META
27 CONTENT="2003-12-22T03:48:47"></HEAD
33 SUMMARY="Header navigation table"
43 >PostgreSQL 7.4.1 Documentation</TH
67 >Chapter 8. Data Types</TD
81 HREF="datatype-pseudo.html"
96 >8.11. Object Identifier Types</A
132 > Object identifiers (OIDs) are used internally by
136 > as primary keys for various system
137 tables. Also, an OID system column is added to user-created tables
141 > is specified at table creation time).
145 > represents an object identifier. There are also
146 several alias types for <TT
170 HREF="datatype-oid.html#DATATYPE-OID-TABLE"
178 > type is currently implemented as an unsigned four-byte
180 Therefore, it is not large enough to provide database-wide uniqueness
181 in large databases, or even in large individual tables. So, using a
182 user-created table's OID column as a primary key is discouraged.
183 OIDs are best used only for references to system tables.
189 > type itself has few operations beyond comparison.
191 integer, however, and then manipulated using the standard integer
192 operators. (Beware of possible signed-versus-unsigned confusion
196 > The OID alias types have no operations of their own except
197 for specialized input and output routines. These routines are able
198 to accept and display symbolic names for system objects, rather than
199 the raw numeric value that type <TT
202 > would use. The alias
203 types allow simplified lookup of OID values for objects: for example,
206 >'mytable'::regclass</TT
207 > to get the OID of table
213 >SELECT oid FROM pg_class WHERE
214 relname = 'mytable'</TT
215 >. (In reality, a much more complicated <TT
219 be needed to deal with selecting the right OID when there are multiple
223 > in different schemas.)
228 NAME="DATATYPE-OID-TABLE"
232 >Table 8-19. Object Identifier Types</B
237 ><COL><COL><COL><COL><THEAD
259 >numeric object identifier</TD
297 >function with argument types</TD
335 >operator with argument types</TD
339 >*(integer,integer)</TT
387 > All of the OID alias types accept schema-qualified names, and will
388 display schema-qualified names on output if the object would not
389 be found in the current search path without being qualified.
396 > alias types will only
397 accept input names that are unique (not overloaded), so they are
398 of limited use; for most uses <TT
405 > is more appropriate. For <TT
409 unary operators are identified by writing <TT
416 > Another identifier type used by the system is <TT
423 >) identifier. This is the data type of the system columns
430 >. Transaction identifiers are 32-bit quantities.
433 > A third identifier type used by the system is <TT
437 command identifier. This is the data type of the system columns
444 >. Command identifiers are also 32-bit quantities.
447 > A final identifier type used by the system is <TT
451 identifier (row identifier). This is the data type of the system column
455 >. A tuple ID is a pair
456 (block number, tuple index within block) that identifies the
457 physical location of the row within its table.
460 > (The system columns are further explained in <A
461 HREF="ddl-system-columns.html"
471 SUMMARY="Footer navigation table"
500 HREF="datatype-pseudo.html"