Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mgpuk-0005Nz-Qo for pgsql-general@arkaria.postgresql.org; Sat, 30 Oct 2021 15:04:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mgpui-0002yx-3s for pgsql-general@arkaria.postgresql.org; Sat, 30 Oct 2021 15:04:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mgpuh-0002yc-J7 for pgsql-general@lists.postgresql.org; Sat, 30 Oct 2021 15:04:55 +0000 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mgpub-0006su-3J for pgsql-general@lists.postgresql.org; Sat, 30 Oct 2021 15:04:54 +0000 Received: by mail-oi1-x22e.google.com with SMTP id w193so17913635oie.1 for ; Sat, 30 Oct 2021 08:04:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=PNxZM1MRSeZWhsJtAZKI4sDc0+wE6DaOhfaLMWY2U8U=; b=d8x744ISJOrpGiIwHB0k3uOYetoVfaOpgsilvvVehc4n93ixctP4/0m6IvpLwEEro0 5XRAazJSmo4bvbUkyq56RyxPezPu5R+9y/DSj56KaM90PuX4TbfBGRXiIXkVoqaoPU91 5CKpy24+R4I7zdfpTrDkGxA0PIcg6/r78nb3IHeXPRV61MXOca419q41XqptQu7SbMXF T6ldMfP3jLG2SZlUmbSBBuw8CpqRR4xmxeyNSwr087gFUouFxQLa/ASJVbsR1uAJU+dL G32X1sRhMvLfiEoRe5IDYqhisT6PNII25LChXxg9teuFsYU6OUS3LhNSlEsKExz2h2/n YVwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=PNxZM1MRSeZWhsJtAZKI4sDc0+wE6DaOhfaLMWY2U8U=; b=fsxp36T74tUjVO0mYFcGX/1U7a59P8LYg95qTcsplV+YSGJ1Fo2YnFipm0DBY/dQKo 18EreaBUcMjl7JMmoYXdFnI674ZOMe96KAS4I+SDUUHCzyhjyaQHInsJJDP5wLC0bQW/ 68qkFR7l0/xAKHJnpoH9pWbplCUXZHN+HGsBhaOpMeZgRWGTLqKj6It2EEsUxr1nCRcz /gGtLZwADBk6xbzvIEEqJTPdTUoX/xMIhABLXNmwIxxV35J+dBlZTfbiOfDZGEhwZrGr ZX8w3ArkEKmYDS1xtEyvX7JmYSPrB1JM0+0+FirEdr8enWkyPhvZ9i89FpF5I9T9VXRz d+1g== X-Gm-Message-State: AOAM530pZNnx78zDeUAFOpDPR7X5zZ/K4yTA3CMxm9e+7BQYF/vH/lsZ pk8vbXdmO6K8bwxwHFJsGwgo4/UD/1U= X-Google-Smtp-Source: ABdhPJy2Gsv7QS03TvM8RjFZfPxYX9uAsngszadk63woGjqd2EMq0QOS7QUz5teUzcFask9A+ciQVQ== X-Received: by 2002:a05:6808:144b:: with SMTP id x11mr18195961oiv.175.1635606288069; Sat, 30 Oct 2021 08:04:48 -0700 (PDT) Received: from [192.168.88.10] (ip68-11-68-85.no.no.cox.net. [68.11.68.85]) by smtp.googlemail.com with ESMTPSA id z22sm2305687oth.63.2021.10.30.08.04.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 30 Oct 2021 08:04:46 -0700 (PDT) Subject: Re: Why does the OID jump by 3 when creating tables? To: pgsql-general@lists.postgresql.org References: From: Ron Message-ID: Date: Sat, 30 Oct 2021 10:04:46 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 create table 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.