Skip site navigation (1) Skip section navigation (2)

Re: With ou Without OID

From: Masse Jacques <jacques(dot)masse(at)bordeaux(dot)cemagref(dot)fr>
To: "'emagin(at)hernas(dot)fr'" <emagin(at)hernas(dot)fr>,pgsql-fr-generale(at)postgresql(dot)org
Subject: Re: With ou Without OID
Date: 2004-05-04 13:44:55
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-fr-generale
Rien du tout. Voir
Un OID unique est créé pour chaque ligne, WITH_OID demande seulement à le
faire apparaître dans un champ spécifique

4.17) What is an OID? What is a TID?
OIDs are PostgreSQL's answer to unique row ids. Every row that is created in
PostgreSQL gets a unique OID. All OIDs generated during initdb are less than
16384 (from backend/access/transam.h). All user-created OIDs are equal to or
greater than this. By default, all these OIDs are unique not only within a
table or database, but unique within the entire PostgreSQL installation.

PostgreSQL uses OIDs in its internal system tables to link rows between
tables. These OIDs can be used to identify specific user rows and used in
joins. It is recommended you use column type OID to store 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 OID's, there is no reason you
can't do it:

        CREATE TABLE new_table(old_oid oid, mycol int);
        SELECT old_oid, mycol INTO new FROM old;
        COPY new TO '/tmp/pgtable';
        DELETE FROM new;
        COPY new WITH OIDS FROM '/tmp/pgtable';
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
values. Tids change after rows are modified or reloaded. They are used by
index entries to point to physical rows.

-----Message d'origine-----
De : emagin(at)hernas(dot)fr [mailto:emagin(at)hernas(dot)fr]
Envoyé : mardi 4 mai 2004 10:46
À : pgsql-fr-generale(at)postgresql(dot)org
Objet : [pgsql-fr-generale] With ou Without OID

Depuis 2 ans que j'ai créé une base sous postgresql 7.3, j'ai une table
sur laquelle il y a beaucoup d'échanges et le dernier OID frise les 17 000
Je risque  quoi et quand?


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

pgsql-fr-generale by date

Next:From: emaginDate: 2004-05-05 06:03:56
Subject: Latin1, Latin2 ..... ou latin10
Previous:From: Jean-Paul ARGUDODate: 2004-05-04 13:03:42
Subject: Re: With ou Without OID

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group