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 1lQvTT-0002Rp-7g for pgsql-admin@arkaria.postgresql.org; Mon, 29 Mar 2021 17:14:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lQvTS-00034C-5e for pgsql-admin@arkaria.postgresql.org; Mon, 29 Mar 2021 17:14:46 +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 1lQvTR-000345-Uo for pgsql-admin@lists.postgresql.org; Mon, 29 Mar 2021 17:14:45 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lQvTP-0005TZ-G1 for pgsql-admin@lists.postgresql.org; Mon, 29 Mar 2021 17:14:45 +0000 Received: by mail-ej1-x62c.google.com with SMTP id hq27so20610431ejc.9 for ; Mon, 29 Mar 2021 10:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=f0QbtyN8Cx0OEdG2IVMILGxFEa3/YvvsyiTBSCRrlDQ=; b=TjS6116iO6eKVbWT//YjOu1GuZXKV4LzRvLyysxOsLoXINDU2IYzoSvY12piw7dFYA 2l9Fm9hfTbefSGjwHcqnzbrVQXkuBU9l9tazHoxXWidI6+E+oVBQMu5JhkVquS+hNO1s AtvJtpTA6DoReuG/ihbeXklpBTzSoUlOfHetH8OvT0Vl/4oCUNnHO9Abzexo3XxtSLov D+sPGlhv7pBiljI0idujaD+zp+f77/dEhWZymDgMw4zDiJTUsyP6tE3MM/b8lPuoSxeQ UaoP7gk3xN7edW7Nu8OrzLiK4Ib5gY56d8gIOmBBjbVZaWp33PcILlhdxBJRuJ+ZhUH/ TSZg== 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:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=f0QbtyN8Cx0OEdG2IVMILGxFEa3/YvvsyiTBSCRrlDQ=; b=gQMdpgpzYaOkkK3Q/OkiIYiSzlMdxHU+Gla5dQ3vjAXcY0HHdCqIyw8QFmEN9IdSSL 7U5z9T8eLeUlVExGFmTdMgFU5Yg33D2PzOraeUDGkCeXbwOIn5YzkUH74zv2oFWeItDC LHEv2PwH9+24Kj+AtlH52TI0aFlIpeVImGmIw0BzG8KhaN5tEgYal6390zbCC3C+Gaj/ 4deFx4jdjj2h7ErhT5/fZp+MCp8/FOO4ozLKZF8JzR1HM7JxqRLG9o56gIcoq+0AzWDo sc/qAiP41MW76RVkR17bsdZZc8oU2pOuI1cx3w/TXwPMB3u44wfb2DvRXMFOCTG/N2Au Z3wQ== X-Gm-Message-State: AOAM530SQo842kfSpsi3rKh9MTPswMG5AxwdvJn/fa9kpwRcS9gY5RFh 6I2n1i3Sk248ZewhelgD5hFbbg== X-Google-Smtp-Source: ABdhPJzjuQqlrVOUdOAcHLFPeXf0298pJvI+yOJW8Iv7bsbz2kq6trxJ0Zkpbw18J0b4zIueMNq+sw== X-Received: by 2002:a17:906:23e9:: with SMTP id j9mr28484192ejg.78.1617038082867; Mon, 29 Mar 2021 10:14:42 -0700 (PDT) Received: from localhost.localdomain (217-149-168-72.nat.highway.telekom.at. [217.149.168.72]) by smtp.gmail.com with ESMTPSA id h22sm8686261eji.80.2021.03.29.10.14.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Mar 2021 10:14:42 -0700 (PDT) Message-ID: Subject: Re: ALTER TABLE ADD COLUMN takes forever From: Laurenz Albe To: Devendra Yadav , pgsql-admin@lists.postgresql.org Date: Mon, 29 Mar 2021 19:14:42 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2021-03-29 at 22:38 +0530, Devendra Yadav wrote: > I am running a query on a table - ALTER TABLE mytable ADD COLUMN deposited DOUBLE PRECISION DEFAULT 0.0; > > this query just runs forever. Then either you are using a PostgreSQL version older than v11, or there is an open transaction that used the table and blocks you. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com