OIDs

Поиск
Список
Период
Сортировка
Искать

OIDs

От:
Philip Reimer <phre@wi.uni-muenster.de>
Дата:
Hi everyone.
I have a simple question which I couldn't find an answer to in any of the
PostgreSQL documentations. How long is an OID in bits? Or otherwise, is
there a limit to OIDs, how big is the biggest OID?
Thanks,
Philip

Re: OIDs

От:
Joe Conway <mail@joeconway.com>
Дата:
Philip Reimer wrote:
> Hi everyone.
> I have a simple question which I couldn't find an answer to in any of the
> PostgreSQL documentations. How long is an OID in bits? Or otherwise, is
> there a limit to OIDs, how big is the biggest OID?
> Thanks,
> Philip
> 

 From ~/pgsql/src/include/postgres_ext.h:


/*
  * Object ID is a fundamental type in Postgres.
  */
typedef unsigned int Oid;

#define InvalidOid ((Oid) 0)

#define OID_MAX UINT_MAX
/* you will need to include  to use the above #define */



So, it depends on the size of unsigned int on your platform.
HTH,

Joe

Re: OIDs

От:
Michael Loftis <mloftis@wgops.com>
Дата:
In general, 32-bits.  Does depend on  how big an unsigned int happens to 
be on your particular platform.  They can roll around back to the start 
also so aren't a very good idea to use for uniqueness if you've got a 
lot of rows you want tracked by oid...

Philip Reimer wrote:

>Hi everyone.
>I have a simple question which I couldn't find an answer to in any of the
>PostgreSQL documentations. How long is an OID in bits? Or otherwise, is
>there a limit to OIDs, how big is the biggest OID?
>Thanks,
>Philip
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster
>


FAQ