Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qn5EL-009pwx-Ul for pgsql-general@arkaria.postgresql.org; Sun, 01 Oct 2023 22:48:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qn5EJ-00FCkK-Km for pgsql-general@arkaria.postgresql.org; Sun, 01 Oct 2023 22:48:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qn5EJ-00FCjn-6H for pgsql-general@lists.postgresql.org; Sun, 01 Oct 2023 22:48:03 +0000 Received: from mail-yw1-x1132.google.com ([2607:f8b0:4864:20::1132]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qn5EC-007g9W-Iu for pgsql-general@lists.postgresql.org; Sun, 01 Oct 2023 22:48:02 +0000 Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-59f7f2b1036so136849487b3.3 for ; Sun, 01 Oct 2023 15:47:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696200475; x=1696805275; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=QtGADIS9blYPWaT0JtAbj8ouAohDPgSIVCEAcpJVk3Q=; b=iOxRNagcOGDxjuXL12MapGhG4GeWtza11F9M7CwbDptpDLJc07FZnNmyHmb+zKSCkd GFjg5gmCXzwWyN4kKihY2bgrlvOPHF4IxjJM+NGiqDV0tf/z/D3hZDzqiI/V5Pd7XwOD 0Y76X1uI5nSgFjhexYjwEMOOc+BD+fIuin2gld0pIr3tOFK+lxoXglm5xDdKt1tQ/H68 eeOJXnRfk3KqjD8qpL2oSuB2VUr9oe3qx/9IWzEdzSWr9so3wz7XK7pBogewCUuxK3Un 4Qrn1iC2E0n24u+p6E0I1cQUl8KrLBtazlehMIRdxET9uORZbxQEQw04y90Xf7fWXyNJ v8bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696200475; x=1696805275; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QtGADIS9blYPWaT0JtAbj8ouAohDPgSIVCEAcpJVk3Q=; b=pX1zAtyonI5fYPW72aXa3YGYVXiw1zHu8OhUpxCHlZ8LJpwWyjCJMu2RZzFalyGfXO WTddTtujJlOl30QzzgAGWQimtWrOwADKiv8M0LWRaoWoTIovhQyWfbFWuRRqdLDty3mc /WVn9X6d87AdPilEigsbQhKPdV5xxHYQPuHWrxq66OcPfSGwQgiFFXX1leEGlb4ZqrVl 9hHv/4JGRxuxYBTgrmpIPKCziXWPqp5TdEDMYtLjLX6Q1qPbto2T2q6BXO5xq+s96a/u bbt2xh4KUfAVQJpNwTfqXnnf2eA6Zt8oh02nGroShPc1taNtcm/gM7USan2nOQNxJhrR xEuw== X-Gm-Message-State: AOJu0Ywt4R6kBs+0P/Y13YeUsQ/QSVCHmb02AtAncC1/AcgvPsOnB5Si JEHT/CsOisudbDs5OXjbqmklCfyirqo= X-Google-Smtp-Source: AGHT+IFqOlxh4KbglJYtaLuuesaS7gMgY2XKCwHDlkbVsaQQcbeEib7CAhwx5idq8B5zibJfjPM5rw== X-Received: by 2002:a81:5b44:0:b0:57a:cf8:5b4 with SMTP id p65-20020a815b44000000b0057a0cf805b4mr8207968ywb.51.1696200474735; Sun, 01 Oct 2023 15:47:54 -0700 (PDT) Received: from ?IPV6:2600:1700:bd2c:b810:75e3:be98:7e14:76fa? ([2600:1700:bd2c:b810:75e3:be98:7e14:76fa]) by smtp.googlemail.com with ESMTPSA id f184-20020a0dc3c1000000b0059ae483b89dsm7335585ywd.50.2023.10.01.15.47.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 01 Oct 2023 15:47:54 -0700 (PDT) Message-ID: Date: Sun, 1 Oct 2023 17:47:54 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: Gradual migration from integer to bigint? Content-Language: en-US To: pgsql-general@lists.postgresql.org References: <624e0261-2c7b-01cf-ec30-3c1e04af2b89@wp.pl> From: Ron In-Reply-To: <624e0261-2c7b-01cf-ec30-3c1e04af2b89@wp.pl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/1/23 12:04, Ireneusz Pluta wrote: > W dniu 30.09.2023 o 07:55, James Healy pisze: >> ... >> We shouldn't have let them get so big, but that's a conversation >> for another day. >> >> Some are approaching overflow and we're slowly doing the work to >> migrate to bigint. Mostly via the well understood "add a new id_bigint >> column, populate on new tuples, backfill the old, switch the PK" >> method. The backfill is slow on these large tables, but it works and >> there's plenty of blog posts and documentation to follow. > wouldn't wrapping to negative numbers like: > https://www.youtube.com/watch?v=XYRgTazYuZ4&t=1338s be a solution for you? > At least for buying more time for the slow migration process. Or even as a > definite solution if you now take care and not let the keys grow too quickly. The application might not react well to negative numbers. -- Born in Arizona, moved to Babylonia.