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 1jyLcE-0002IL-Gy for pgsql-general@arkaria.postgresql.org; Wed, 22 Jul 2020 20:45:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jyLcB-0006sk-RW for pgsql-general@arkaria.postgresql.org; Wed, 22 Jul 2020 20:45:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jyLcB-0006sd-EQ for pgsql-general@lists.postgresql.org; Wed, 22 Jul 2020 20:45:23 +0000 Received: from mx4.wp.pl ([212.77.101.11]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jyLc4-0007yr-HQ for pgsql-general@postgresql.org; Wed, 22 Jul 2020 20:45:23 +0000 Received: (wp-smtpd smtp.wp.pl 10143 invoked from network); 22 Jul 2020 22:45:13 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1595450713; bh=aUUxV9w/h8aBNQpDgmJr7b1AtVeeXaRE4cbmxh8nk0s=; h=Subject:To:From; b=hKhZyaCB43dRLmsSeWghSKhgSPr1UGP8PK1z2oLrmITf29I9r+Ru1I6epxyNvxaOr TyhE5H8Mqqf2I1wbKX64XMcZgTT08aRxoB/7ABOofo5b13Gfs4x7yryCWtc/P09AIY mTZQP54jFHxNkF68sD+AFKbiKxexQU4I7MyGq5V4= Received: from aauq235.neoplus.adsl.tpnet.pl (HELO [10.0.0.82]) (ipluta@wp.pl@[83.6.24.235]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 22 Jul 2020 22:45:13 +0200 Subject: Re: Switching Primary Keys to BigInt To: Mohamed Wael Khobalatte , pgsql-general@postgresql.org References: From: "Ireneusz Pluta/wp.pl" Message-ID: <168ca1b5-62bb-b210-bcd0-e1a9faacf728@wp.pl> Date: Wed, 22 Jul 2020 22:45:07 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: pl X-WP-MailID: 34456058de181a55bc573627bb13d9ef X-WP-AV: skaner antywirusowy Poczty Wirtualnej Polski X-WP-SPAM: NO 0000001 [UQJx] List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk W dniu 2020-07-21 o 17:30, Mohamed Wael Khobalatte pisze: > we are planning to move some primary keys from int to bigint because we are approaching the type limit If that does not break your business logic, you might arrange to use the negative half of the ::int value range. Ugly, but this might at least buy you some time before finding the definite and elegant way, if you are under some pressure. I do not recommend this, but this is what once saved my life (or at least one night), after I realized that my PK already reached the limit :-).