Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1irnQT-0003QU-Mi for pgsql-general@arkaria.postgresql.org; Wed, 15 Jan 2020 18:29:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1irnQS-0006dx-6E for pgsql-general@arkaria.postgresql.org; Wed, 15 Jan 2020 18:29:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1irnQQ-0006dp-W2 for pgsql-general@lists.postgresql.org; Wed, 15 Jan 2020 18:29:55 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1irnQJ-0007LY-RE for pgsql-general@lists.postgresql.org; Wed, 15 Jan 2020 18:29:53 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id A3AC42221E; Wed, 15 Jan 2020 13:29:46 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 15 Jan 2020 13:29:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=w n4AhJ+KDGb1eNbqmTa6QuB8EFCV7iY6d8Vob2/iwlE=; b=N0A5YXN126ej/jqIe PJVg01Ha50ilVyCt4Uc1AUEaGWG6QSKMpLy1HZ77/Hb1do9zKcpeLEFPoH5uyEVd B/ZGZb2kJfpUmf0GOqCeWr+My4MImm7iAlsSilJPXOSTzHXKQITNcS7ihcds1uiR cGZ1bvyPUQLzu8XFdu+iXD/d7Z2sgs578hhOl7D/rWeOg9r7NImoCWTBB0Ygo+TL 1qFOt6lXrbozVZmzr4fnPDjtwkW9caPyJf3ZuY6uSF7KGu7Bpzf5jH1R/BIFFFy5 lGKNUE+i3jbVNTkWeefgAPH2z019MO21PVOWy23Oc71r0cGNp1PzcwL+yks5eu0N Rr9Fg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=wn4AhJ+KDGb1eNbqmTa6QuB8EFCV7iY6d8Vob2/iw lE=; b=IeP55dWi7GLIs/0adONWN5/2NHd7KBtXJmWTy4T413qkgMmF+C6E6Star XvOWwTyrbl6bxPn8xqxnmIYHiuzU6aZUREuN0eH+T5086mle1GnJKAlAvbyAtFVa Aa40PWLYlGnBb97Rotw6eAxZ78X556kS9xTHJekCGqsq9yZ9VjqpmOFXn1hOb+My yVUfHVUgwXyi53sM7c8iok39w0YmONhWtMUxX98Ls8tlLvnQYerr2ZlHnU9ssZTP 7vaz5DldY4bd/8Cm029eEDilT6ffvuCXLDwMZNa3s7YlzNc1zjPZHhxPcoiEWPCd blTa5YC1kRmwk770P/olR7vGxsYLA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtdefgdduuddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecukfhppeejuddrvddu vddruddvledrudelfeenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklh grvhgvrhesrghklhgrvhgvrhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.10] (unknown [71.212.129.193]) by mail.messagingengine.com (Postfix) with ESMTPA id 07DFB30602DE; Wed, 15 Jan 2020 13:29:45 -0500 (EST) Subject: Re: OID out of range To: Konireddy Rajashekar , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: Date: Wed, 15 Jan 2020 10:29:45 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 1/15/20 10:18 AM, Konireddy Rajashekar wrote: > I am getting ERROR: OID out of range while firing below SQL , what could > be the reason? I am joining pg_class and one user_created table to > compare tables size. > > select u.relid,c.relnamespace::regnamespace::text,c.relname,now() as current_time,pg_size_pretty(pg_relation_size(c.oid)) as current_size,pg_size_pretty(u.table_size) as previous_size,pg_size_pretty(pg_relation_size(c.oid) - pg_relation_size(u.table_size)) as diff from user_tables_sizes u join pg_class c on u.relid::bigint = c.oid::bigint where c.relkind='r' and c.relnamespace::regnamespace::text='rpx_reporting_stage' and u.captured_dt::date=current_date - interval '1 days'ERROR: OID out of rangetest-# \d user_tables_sizes Given this: https://www.postgresql.org/docs/12/datatype-oid.html "The oid type is currently implemented as an unsigned four-byte integer. " I am pretty sure this: c.oid::bigint is the problem. -- Adrian Klaver adrian.klaver@aklaver.com