Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6Ljh-0003vZ-VZ for pgsql-admin@arkaria.postgresql.org; Tue, 19 Mar 2019 20:53:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h6Ljg-0003hN-KO for pgsql-admin@arkaria.postgresql.org; Tue, 19 Mar 2019 20:53:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6Ljg-0003hG-Ce for pgsql-admin@lists.postgresql.org; Tue, 19 Mar 2019 20:53:24 +0000 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6Lje-0007Tv-2X for pgsql-admin@lists.postgresql.org; Tue, 19 Mar 2019 20:53:23 +0000 Received: by mail-lj1-x22f.google.com with SMTP id f23so359359ljc.0 for ; Tue, 19 Mar 2019 13:53:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=V+1EMgA2zuJqVBiJXo14R/rh0wa41FM8VXB4AowiHMs=; b=KVqnTR8sqHwOM+kMvuDJ7CoBsnqcICK4rVqCNNWjI8X1VHQ2i280/40hwmTPBxXTn5 OgM6z6qa//S0bkoNfJhEj+YRVS8t+n8Hv6NUlNbmfDBDwxqTGF6lxrFwHnlgj0yZVtlc Y5+BJZQYUP3UVpZdMj2pu4HTi8oF6YBMynRiRzDMua6dP1Lcbv/6QEZKM6l1qGq6+00U Zhj00hBDFheaIztHlu4+jZgh614Yd1YY6gBrcL2SPamb0NrtuLUr3fuV9Uuo/cLEwPlu vr04YvXPgJAaWesOxdopeYqbT4duvBZCTFyu+Cz0Vr1JSSqGPMHhymO0dfNrHnVton0+ JheA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=V+1EMgA2zuJqVBiJXo14R/rh0wa41FM8VXB4AowiHMs=; b=t8IKvTe7UlUW1GT9Pdw83tGMUnXM46Ow/enmKbaxPaVcIZRlQkljK6QX+HS5TJWKly y+Qyo3/fyHdaV4LIwC9MYwcZupIlAnYSWIWvGTUPW14BYf8ObxXY3oUK7nB0YNc4IHVl 1lx3rszNY8edS4T1mexFGuw7mKU1ZoZW6ytC42DngC2Qhmgsj6mjpeUUPA4oRm1ERZnv yFB5HExgMyLAtPJxAqA3fn9BuLuWK1Y8/rpVqqTZ33or6uy6ZKceAB8R/TDzi3WIMwBf 5rYJp8HRXXvvJTZ1mCt8Ax2yX1PN0JapIFDFqHgHn9L3szkTjbj3zEPDRD6xDC8dCQ95 Boew== X-Gm-Message-State: APjAAAXPPc+Qdu9cpyR6TSmeMMf7FBLtzlpNbQLHrW/pLHaGyHe9hutU SPF0Ki7jPhrxwbPD1w+I1D4dLx/Y X-Google-Smtp-Source: APXvYqz3mdb/HRliAlVol/m6g08ScYHLL4DuI09DvW3mdeEaTM7FEh/gjCLMKWbw6FDgWoANsxoAKg== X-Received: by 2002:a2e:6505:: with SMTP id z5mr15278494ljb.180.1553028799985; Tue, 19 Mar 2019 13:53:19 -0700 (PDT) Received: from ?IPv6:2a02:a31c:853d:4000:e6b3:18ff:fe8c:d0c0? ([2a02:a31c:853d:4000:e6b3:18ff:fe8c:d0c0]) by smtp.googlemail.com with ESMTPSA id n2sm124637lfe.71.2019.03.19.13.53.18 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 19 Mar 2019 13:53:18 -0700 (PDT) Subject: Re: Adding Column on Huge Table To: "pgsql-admin@lists.postgresql.org" References: From: Andrzej Zawadzki Message-ID: <5b26ed21-a7b5-6c1b-af10-10df4d44a4f7@gmail.com> Date: Tue, 19 Mar 2019 21:53:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: Content-Type: text/html; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk
On 19.03.2019 16:56, Moin Akther wrote:
Dear Experts,

We want to add a column on table size of 1.5TB, we have to perform this activity with minimal downtime. 

What are the best practises to add a column on huge table ?

How much time alter statement will take to add column ?

Any alternate solution other than alter statement to add column ?

Will adding a new column on a huge table generate huge WAL files ?

No offense, but don't you have any test environment?

Try that or maybe you have so show times.


--

Andrzej Zawadzki