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 1sTaxB-000JOk-JP for pgsql-general@arkaria.postgresql.org; Tue, 16 Jul 2024 05:42:21 +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 1sTaxA-00FmqR-1D for pgsql-general@arkaria.postgresql.org; Tue, 16 Jul 2024 05:42:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sTax9-00FmqJ-Mb for pgsql-general@lists.postgresql.org; Tue, 16 Jul 2024 05:42:19 +0000 Received: from mail-oo1-xc2f.google.com ([2607:f8b0:4864:20::c2f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sTax7-002MQs-Jz for pgsql-general@lists.postgresql.org; Tue, 16 Jul 2024 05:42:19 +0000 Received: by mail-oo1-xc2f.google.com with SMTP id 006d021491bc7-5c6924f2383so2471415eaf.2 for ; Mon, 15 Jul 2024 22:42:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721108535; x=1721713335; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=KzTAHxtsMK6TE2qYqzUtDGAEr7UCHothqDCNbEl3he8=; b=G+4sneQGM21uDql1/cuknhege7xkYHfTkOJeqTAEbD0ifX8IEePwnGBIz1E2BMG7F6 SEhYzkJSl3U6nXKd87GkiFg5usmYT9V0EtJcj+YEw/n9Ah3UMO/gLz4VakSPypY8xdNk YNeDRm9rGR8QwrAI5JjXUqTkzCoH0nQ3gUQ/UbyYB6AWrtu1m0jkBw/OeADTU6yoc8WD EKUDCpwD6EbxFCQmP8gxd72fVuv4EBUQDOhSTQHnJulv9rTyC404Fk096qotmE+EuBCR DfftvlhjpEpVq+18yMLlQHsHoA3KP3R8GxG6GBWaVUgABmR5ge93Ct4hQws8VYUYk+g9 4UxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721108535; x=1721713335; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KzTAHxtsMK6TE2qYqzUtDGAEr7UCHothqDCNbEl3he8=; b=MWTiaUMXR5jj4ZTIPRFqtQQljN4zWJgSAMPqC/E+AP4mYDtAZ/NGQhLTLzPXenVTqN cZr8otg62tsCrzwRjawU1Li8PyuZOpjzQFt6TglmjHxffyfTPEtTwcEuFcy67GiCjdDZ JXmpjFbc4DxzpHRauXEE0P+0/7/kmlhk/pODQh7mjJZVh2wvyFWkxl6LJiQM0zWOvCht PjNtY1mRjwra4s/g6OigelVQOBaNypZNEae+U/Loy1tiarcyuRogPZhqXWDwse8uhgpJ 1YNpomOkFyGJv2OkR8JfI5hYqoNcUx8yPxaDVEZfDwFh1fjgNQJWeDh8UWEnmCvOWJ9J 0dBg== X-Gm-Message-State: AOJu0YxSj+akpN8YsP0vPDwZGKlB5xrOhNUiNa5/xE6lCc3Qx8L/N3jc hdFh2SdlxL2OnV5TnnME4i5n0QU8SaC1w80gtD1PdjOFviPZ4t6hNEq+ySdnqNfp4HhmDRyoEt+ 0J6ZEWRnl+DT8ARnC6WpsKnWHVvo= X-Google-Smtp-Source: AGHT+IEQC0dPPHueBw9l8+3zcu18lBNGWbY0OFMhpn65OEOL5R72T8Vj7VJEFmyTC0fIpG8I36NVd2c+HMsXYlP46No= X-Received: by 2002:a4a:edc8:0:b0:5c4:3977:a247 with SMTP id 006d021491bc7-5d284065716mr1611602eaf.0.1721108535362; Mon, 15 Jul 2024 22:42:15 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:760a:0:b0:539:aa10:6c7 with HTTP; Mon, 15 Jul 2024 22:42:14 -0700 (PDT) In-Reply-To: References: <20240713220545.cgjghaggksov3xkt@hjp.at> <20240715142744.7e7a3wtdfxinochf@hjp.at> <20240716003731.m75sye7qq74wadhe@hjp.at> From: "David G. Johnston" Date: Mon, 15 Jul 2024 22:42:14 -0700 Message-ID: Subject: Re: Dropping column from big table To: sud Cc: "pgsql-general@lists.postgresql.org" , "Peter J. Holzer" Content-Type: multipart/alternative; boundary="000000000000deccc1061d56ceed" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000deccc1061d56ceed Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Monday, July 15, 2024, sud wrote: > > Thank you for the confirmation. > And if someone wants to fully remove that column from the table , then th= e > only option is to create a new table with an exact set of active columns > and insert the data into that from the existing/old table and then rename > it back to old. Is this correct understanding? > You haven=E2=80=99t removed the column from the table, you=E2=80=99ve remov= ed the whole dang table while creating a new, wholly unrelated, one that just happens to have the same name. But the name of a table isn=E2=80=99t its primary key,= though some places do use it for lookup purposes. David J. --000000000000deccc1061d56ceed Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Monday, July 15, 2024, sud <sud= s1434@gmail.com> wrote:

Thank you for the confirmation.=C2=A0
And if someone wants to fully remove that column from the table , then t= he only option is to create a new table with an exact set of active columns= and insert the data into that from the existing/old table and then rename = it back to old. Is this correct understanding?

You haven=E2=80=99t removed the column from the table= , you=E2=80=99ve removed the whole dang table while creating a new, wholly = unrelated, one that just happens to have the same name.=C2=A0 But the name = of a table isn=E2=80=99t its primary key, though some places do use it for = lookup purposes.

David J.

--000000000000deccc1061d56ceed--