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 1hidru-0008MD-R0 for pgsql-general@arkaria.postgresql.org; Wed, 03 Jul 2019 11:56:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hidrt-0003to-L2 for pgsql-general@arkaria.postgresql.org; Wed, 03 Jul 2019 11:56:09 +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 1hidrt-0003th-Bh for pgsql-general@lists.postgresql.org; Wed, 03 Jul 2019 11:56:09 +0000 Received: from mout.kundenserver.de ([212.227.126.135]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hidrq-0004id-Bo for pgsql-general@lists.postgresql.org; Wed, 03 Jul 2019 11:56:08 +0000 Received: from [10.8.0.6] ([185.40.248.10]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPSA (Nemesis) id 1MKsaz-1hxHuI3vQr-00LGBe for ; Wed, 03 Jul 2019 13:56:03 +0200 Subject: Re: Too short field To: pgsql-general@lists.postgresql.org References: <78d5b939297348b8856d457be7a63e7e@UKEXCHMBX003.TechMahindra.com> From: Thomas Kellerer Message-ID: Date: Wed, 3 Jul 2019 13:56:03 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 In-Reply-To: <78d5b939297348b8856d457be7a63e7e@UKEXCHMBX003.TechMahindra.com> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:h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+dwEAEsM= List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Karl Martin Skoldebrand schrieb am 03.07.2019 um 13:30: > Now, we have a bug in another application that prevents an automatic > tool to enter certain users in the database. The organisational field > is varchar(60) while the actual Organisation “abbreviation” may be as > long as 70 characters (don’t ask why). > > What happens to data if I simple redefine the table field as > varchar(80) (or something, at least 70+). Does “everything” break > database side or can I just go on running the app as is. Nothing will break on the database size. > Do we need to restart databases or something else that requires an > interrupted service? No, you just run ALTER the_table ALTER COLUMN organisational TYPE varchar(80); It requires an exclusive lock on the table, but the actual operation will finish in a few milliseconds because the table is not physically changed (as the limit is only increased). Getting the exlusive lock might take a while if the table is actively used, so the ALTER statement itself might look as it would take a while, but once the lock could be obtained the change is very fast. There is no real need to stop anything if you can anticipate that there will be a few (milli)seconds where the ALTER statement succeeds in obtainin (and releasing) the lock.