Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
811df913
Commit
811df913
authored
Jan 30, 2005
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update OID item description.
parent
64428b8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
59 deletions
+26
-59
doc/FAQ
doc/FAQ
+11
-27
doc/src/FAQ/FAQ.html
doc/src/FAQ/FAQ.html
+15
-32
No files found.
doc/FAQ
View file @
811df913
Frequently Asked Questions (FAQ) for PostgreSQL
Frequently Asked Questions (FAQ) for PostgreSQL
Last updated:
Wed Jan 19 14:45:22
EST 2005
Last updated:
Sat Jan 29 21:05:17
EST 2005
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
...
@@ -956,32 +956,16 @@ BYTEA bytea variable-length byte array (null-byte safe)
...
@@ -956,32 +956,16 @@ BYTEA bytea variable-length byte array (null-byte safe)
4.15) What is an OID? What is a TID?
4.15) What is an OID? What is a TID?
OIDs are PostgreSQL's answer to unique row ids. Every row that is
Every row that is created in PostgreSQL gets a unique OID unless
created in PostgreSQL gets a unique OID. All OIDs generated during
created WITHOUT OIDS. OIDs are autotomatically assigned unique 4-byte
initdb are less than 16384 (from include/access/transam.h). All
integers that are unique across the entire installation. However, they
user-created OIDs are equal to or greater than this. By default, all
overflow at 4 billion, and then the OIDs start being duplicated.
these OIDs are unique not only within a table or database, but unique
PostgreSQL uses OIDs to link its internal system tables together.
within the entire PostgreSQL installation.
To uniquely number columns in user tables, it is best to use SERIAL
PostgreSQL uses OIDs in its internal system tables to link rows
rather than OIDs because SERIAL sequences are unique only within a
between tables. These OIDs can be used to identify specific user rows
single table. and are therefore less likely to overflow. SERIAL8 is
and used in joins. It is recommended you use column type OID to store
available for storing eight-byte sequence values.
OID values. You can create an index on the OID field for faster
access.
OIDs are assigned to all new rows from a central area that is used by
all databases. If you want to change the OID to something else, or if
you want to make a copy of the table, with the original OIDs, there is
no reason you can't do it:
CREATE TABLE new_table(mycol int);
SELECT oid AS old_oid, mycol INTO tmp_table FROM old_table;
COPY tmp_table TO '/tmp/pgtable';
COPY new_table WITH OIDS FROM '/tmp/pgtable';
DROP TABLE tmp_table;
OIDs are stored as 4-byte integers, and will overflow at 4 billion. No
one has reported this ever happening, and we plan to have the limit
removed before anyone does.
TIDs are used to identify specific physical rows with block and offset
TIDs are used to identify specific physical rows with block and offset
values. TIDs change after rows are modified or reloaded. They are used
values. TIDs change after rows are modified or reloaded. They are used
...
...
doc/src/FAQ/FAQ.html
View file @
811df913
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
alink=
"#0000ff"
>
alink=
"#0000ff"
>
<H1>
Frequently Asked Questions (FAQ) for PostgreSQL
</H1>
<H1>
Frequently Asked Questions (FAQ) for PostgreSQL
</H1>
<P>
Last updated:
Wed Jan 19 14:45:22
EST 2005
</P>
<P>
Last updated:
Sat Jan 29 21:05:17
EST 2005
</P>
<P>
Current maintainer: Bruce Momjian (
<A
href=
<P>
Current maintainer: Bruce Momjian (
<A
href=
"mailto:pgman@candle.pha.pa.us"
>
pgman@candle.pha.pa.us
</A>
)
<BR>
"mailto:pgman@candle.pha.pa.us"
>
pgman@candle.pha.pa.us
</A>
)
<BR>
...
@@ -1190,37 +1190,20 @@ BYTEA bytea variable-length byte array (null-byte safe)
...
@@ -1190,37 +1190,20 @@ BYTEA bytea variable-length byte array (null-byte safe)
<H4><A
name=
"4.15"
>
4.15
</A>
) What is an
<SMALL>
OID
</SMALL>
? What is
<H4><A
name=
"4.15"
>
4.15
</A>
) What is an
<SMALL>
OID
</SMALL>
? What is
a
<SMALL>
TID
</SMALL>
?
</H4>
a
<SMALL>
TID
</SMALL>
?
</H4>
<P><SMALL>
OID
</SMALL>
s are PostgreSQL's answer to unique row ids.
<P>
Every row that is created in PostgreSQL gets a unique
Every row that is created in PostgreSQL gets a unique
<SMALL>
OID
</SMALL>
unless created
<SMALL>
WITHOUT OIDS
</SMALL>
.
<SMALL>
OID
</SMALL>
. All
<SMALL>
OID
</SMALL>
s generated during
O
<SMALL>
ID
</SMALL>
s are autotomatically assigned unique 4-byte
<I>
initdb
</I>
are less than 16384 (from
integers that are unique across the entire installation. However,
<I>
include/access/transam.h
</I>
). All user-created
they overflow at 4 billion, and then the O
<SMALL>
ID
</SMALL>
s start
<SMALL>
OID
</SMALL>
s are equal to or greater than this. By default,
being duplicated. PostgreSQL uses
<SMALL>
OID
</SMALL>
s to link its
all these
<SMALL>
OID
</SMALL>
s are unique not only within a table or
internal system tables together.
</P>
database, but unique within the entire PostgreSQL installation.
</P>
<P>
To uniquely number columns in user tables, it is best to use
<P>
PostgreSQL uses
<SMALL>
OID
</SMALL>
s in its internal system
<SMALL>
SERIAL
</>
rather than O
<SMALL>
ID
</SMALL>
s because
tables to link rows between tables. These
<SMALL>
OID
</SMALL>
s can
<SMALL>
SERIAL
<SMALL>
sequences are unique only within a single
be used to identify specific user rows and used in joins. It is
table. and are therefore less likely to overflow.
recommended you use column type
<SMALL>
OID
</SMALL>
to store
<SMALL>
SERIAL8
</SMALL>
is available for storing eight-byte sequence
<SMALL>
OID
</SMALL>
values. You can create an index on the
values.
</P>
<SMALL>
OID
</SMALL>
field for faster access.
</P>
<P>
O
<SMALL>
ID
</SMALL>
s are assigned to all new rows from a central
area that is used by all databases. If you want to change the
<SMALL>
OID
</SMALL>
to something else, or if you want to make a copy
of the table, with the original
<SMALL>
OID
</SMALL>
s, there is no
reason you can't do it:
</P>
<PRE>
CREATE TABLE new_table(mycol int);
SELECT oid AS old_oid, mycol INTO tmp_table FROM old_table;
COPY tmp_table TO '/tmp/pgtable';
COPY new_table WITH OIDS FROM '/tmp/pgtable';
DROP TABLE tmp_table;
</PRE>
<P>
O
<SMALL>
ID
</SMALL>
s are stored as 4-byte integers, and will
overflow at 4 billion. No one has reported this ever happening, and
we plan to have the limit removed before anyone does.
</P>
<P>
T
<SMALL>
ID
</SMALL>
s are used to identify specific physical rows
<P>
T
<SMALL>
ID
</SMALL>
s are used to identify specific physical rows
with block and offset values. T
<SMALL>
ID
</SMALL>
s change after rows
with block and offset values. T
<SMALL>
ID
</SMALL>
s change after rows
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment