Précédent   Forum des professionnels en informatique > Bases de données > PostgreSQL
PostgreSQL Forum PostgreSQL. Avant de poster -> F.A.Q PostGreSQL Tutoriels PostGreSQL
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 29/06/2005, 10h48   #1
Membre du Club
 
Inscription : mars 2005
Messages : 277
Détails du profil
Informations forums :
Inscription : mars 2005
Messages : 277
Points : 42
Points : 42
Par défaut OID ?

Bonjour,

Je recupere le dernier enregistrement de ma table à l aide de l'OID.
Je voudrais savoir le derniere enregistrement aura toujours l'OID le plus grand ?

Merci.
Melvine est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/06/2005, 11h38   #2
Membre éclairé
 
Inscription : janvier 2005
Messages : 336
Détails du profil
Informations personnelles :
Âge : 34

Informations forums :
Inscription : janvier 2005
Messages : 336
Points : 353
Points : 353
Reponse lu dans la doc

Citation:
OIDs are 32-bit quantities and are assigned from a single cluster-wide counter. In a large or long-lived database, it is possible for the counter to wrap around. Hence, it is bad practice to assume that OIDs are unique, unless you take steps to ensure that this is the case. If you need to identify the rows in a table, using a sequence generator is strongly recommended. However, OIDs can be used as well, provided that a few additional precautions are taken:

A unique constraint should be created on the OID column of each table for which the OID will be used to identify rows.

OIDs should never be assumed to be unique across tables; use the combination of tableoid and row OID if you need a database-wide identifier.

The tables in question should be created using WITH OIDS to ensure forward compatibility with future releases of PostgreSQL. It is planned that WITHOUT OIDS will become the default.
Donc les OID sont à éviter en tant qu'identifiant unique car ils peuvent reboucler.

KrysKool
kryskool est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/06/2005, 13h28   #3
Membre du Club
 
Inscription : mars 2005
Messages : 277
Détails du profil
Informations forums :
Inscription : mars 2005
Messages : 277
Points : 42
Points : 42
merci
Melvine est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 04h31.


 
 
 
 
Partenaires

Hébergement Web