Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bbTjv-0002qE-4I for pgsql-hackers@arkaria.postgresql.org; Sun, 21 Aug 2016 14:28:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bbTjt-0004pV-Pl for pgsql-hackers@arkaria.postgresql.org; Sun, 21 Aug 2016 14:28:41 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bbTjq-0004oB-PG for pgsql-hackers@postgresql.org; Sun, 21 Aug 2016 14:28:38 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bbTjn-0004Y2-Bx for pgsql-hackers@postgresql.org; Sun, 21 Aug 2016 14:28:37 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u7LESI53006630; Sun, 21 Aug 2016 10:28:18 -0400 From: Tom Lane To: emre@hasegeli.com cc: =?UTF-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= , PostgreSQL Hackers , Andrew Dunstan , Matthias Kurz , Jim Nasby , "David G. Johnston" Subject: Re: [PATCH] Alter or rename enum value In-reply-to: References: <56E049CC.8010201@dunslane.net> <25605.1457539654@sss.pgh.pa.us> <56E05635.70908@dunslane.net> <28167.1457543612@sss.pgh.pa.us> Comments: In-reply-to Emre Hasegeli message dated "Sun, 21 Aug 2016 15:49:16 +0200" Date: Sun, 21 Aug 2016 10:28:18 -0400 Message-ID: <6629.1471789698@sss.pgh.pa.us> X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Emre Hasegeli writes: >> + ReleaseCatCacheList(list); >> + heap_close(pg_enum, RowExclusiveLock); > Maybe we better release them before reporting error, too. I would > release the list after the loop, close the heap before ereport(). Transaction abort will clean up such resources just fine; if it did not, then any function you call would have problems if it threw an error. I would not contort the logic to free stuff before ereport. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers