Re: Why does the OID jump by 3 when creating tables?

Поиск
Список
Период
Сортировка
От Ron
Тема Re: Why does the OID jump by 3 when creating tables?
Дата
Msg-id be8d2870-bc8f-394e-0737-aa73259af059@gmail.com
обсуждение исходный текст
Ответ на Why does the OID jump by 3 when creating tables?  ("Daniel Westermann (DWE)" <daniel.westermann@dbi-services.com>)
Список pgsql-general
On 10/30/21 3:55 AM, Daniel Westermann (DWE) wrote:
> Hi all,
>
> as I could not find the reason in the source code, can someone tell me why the OID counter jumps by 3 between two
createtable statements?
 
>
> postgres=# create table t1 ( a int );
> CREATE TABLE
> postgres=# create table t2 ( a int );
> CREATE TABLE
> postgres=# select oid,relname from pg_class where relname in ('t1','t2');
>    oid  | relname
> -------+---------
>   16453 | t1
>   16456 | t2
> (2 rows)
>
> These seems not to happen with other objects, e.g. namespaces:
>
> postgres=# create schema a;
> CREATE SCHEMA
> postgres=# create schema b;
> CREATE SCHEMA
> postgres=# select oid,nspname from pg_namespace where nspname in ('a','b');
>    oid  | nspname
> -------+---------
>   16459 | a
>   16460 | b
> (2 rows)
>
> ... or indexes:
>
> postgres=# select oid,relname from pg_class where relname in ('i1','i2');
>    oid  | relname
> -------+---------
>   16461 | i1
>   16462 | i2
>

I'd run this, and see if the results answer the question:

select oid,relname, reltype from pg_class where oid between 16453 and 16455;

-- 
Angular momentum makes the world go 'round.



В списке pgsql-general по дате отправления:

Предыдущее
От: "Daniel Westermann (DWE)"
Дата:
Сообщение: Re: Why does the OID jump by 3 when creating tables?
Следующее
От: SQL Padawan
Дата:
Сообщение: Settings for a new machine - some guidance sought.