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 1kax5m-0007Ad-Mh for pgsql-admin@arkaria.postgresql.org; Fri, 06 Nov 2020 08:27:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kax5l-0000yM-KW for pgsql-admin@arkaria.postgresql.org; Fri, 06 Nov 2020 08:27:29 +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 1kax5l-0000yE-8F for pgsql-admin@lists.postgresql.org; Fri, 06 Nov 2020 08:27:29 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kax5i-0002zE-Ic for pgsql-admin@lists.postgresql.org; Fri, 06 Nov 2020 08:27:28 +0000 Received: by mail-ed1-x530.google.com with SMTP id v4so415998edi.0 for ; Fri, 06 Nov 2020 00:27:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=9yzS3v1hD7uOaIiSFhLLt2rN5GCbA9lgCyJ/TY77Ivc=; b=2FlrZdz9iyrIui8Yy5GkxkwOdQWFh16U3ETw7rGTAJgr8IWw+Tb/ZtQZM8+vwJ4C5l yTm6Hb0HkCQG2YHq6olnHhu7lGFPbDiO1BvSJpaH5bhx6UTOe4WaFIT/eU05roYLdeRU WrIzoxZsoxyKFVEZSxNJ+cTnx59eZYpYUGf2nhua2aRQDWqKhrVE3udB/bA2KF49BYEV EtNKd3xkzNztT3U2yP0TcnEwgAkRcttpb+Wz+8VuQoaDgVM8/+JqRxn6JJwMIlKB3nF7 RRuQOTbsTaW4uflnFs+FRJf+NdQvBM30k9Ux1LSopK4wrzFIB5oPTTK9tRK5Yo3eJZh0 oHTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=9yzS3v1hD7uOaIiSFhLLt2rN5GCbA9lgCyJ/TY77Ivc=; b=NAi3h2JEi49e7kJ3t8JNYbKs+zDbmhjOkNnT0AIlV+7IO7iw5UWf17AGjopdAAXbVJ qDUE1X0lJbDdpM/W7VCB5v9U5t42k1Wm9zLXeMP4tz/XF1ygV0jSAjlvl2nllzdMhInI 4UozjK6PRWXqPnJ1v/jnLNU45OFkwhTVQgRi1sGBCZ/go53Arngsw/gPr7ggQkjMzmRk CRZh4rAlZj69OBEFPTXB6VrGaDU8BabnwGvcC3HNmsIMqPPvVUZ7BTnhVVEiYPEbWnz0 OAPehsTIq5dnMS9/HkAsCDNlL1fGi68J4Zmlv8ktXiNlzDraWY3kEkz623aF9sO+Rd/G 2tPA== X-Gm-Message-State: AOAM5307ND+dEVgmGKxUiAyQAZxWRx+zYtIPJVkZyNbbi8LJWPlvFoDQ Z5vPvA2i3mpPo2fM4vJQbAnH7g== X-Google-Smtp-Source: ABdhPJy1u/z0hGz0qIrvnqqvYOZ8WQ1uIhL+6ZHpS5aym8X1yzD7neZ1LGroVpdsZTz8nyh/dFLlJA== X-Received: by 2002:a05:6402:1765:: with SMTP id da5mr827677edb.155.1604651244415; Fri, 06 Nov 2020 00:27:24 -0800 (PST) Received: from localhost.localdomain (217-149-174-206.nat.highway.telekom.at. [217.149.174.206]) by smtp.gmail.com with ESMTPSA id u26sm459971edt.39.2020.11.06.00.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2020 00:27:23 -0800 (PST) Message-ID: Subject: Re: Change from BIGINT to INT in prod. From: Laurenz Albe To: "David G. Johnston" , Walters Che Ndoh Cc: Pgsql-admin Date: Fri, 06 Nov 2020 09:27:22 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 2020-11-05 at 11:23 -0700, David G. Johnston wrote: > > So when i try running alter table table_name alter column column_name type INT; , it is hanging and starts providing a lock on the table. It has to rewrite the table and needs an AccessExclusive lock. You have to suspend all concurrent activity on that table. > I'm not seeing the point of doing this specific conversion at all really Exactly; this exercise is not necessary. The few bytes you are saving are not worth the trouble. Yours, Laurenz Albe -- +43-670-6056265 CYBERTEC PostgreSQL International GmbH Gröhrmühlgasse 26, A-2700 Wiener Neustadt Web: https://www.cybertec-postgresql.com