Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g9V3R-0007GK-Ok for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Oct 2018 12:54:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g9V3P-0006mg-V8 for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Oct 2018 12:54:31 +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.89) (envelope-from ) id 1g9V3P-0006mZ-Kg for pgsql-hackers@lists.postgresql.org; Mon, 08 Oct 2018 12:54:31 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g9V3M-0006OD-B2 for pgsql-hackers@postgresql.org; Mon, 08 Oct 2018 12:54:30 +0000 Received: by mail-qt1-x841.google.com with SMTP id u34-v6so20766793qth.3 for ; Mon, 08 Oct 2018 05:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=PzkBa+m5T1oOyM+GLvf9oIXRu5HH5HPNs81Hb7qEfqM=; b=jqU92N9vYgW9Im9p9OUXq0UxApvoSzbxsISftBFhIrlRcOi7ItnXaECungZhUp2haI RipjFuCL6O/sGp0biNVqHlpta64rtnqGAoFJn84qr87brF27UMduaTgPjBpwqQMxOcD3 ACN5s9QqCyemx4jM7y7tGv9+ReqQfLGiIdaimxSkEDpGgMNJiD3uQnIN+a157BidkG1D /6s2S8oLEKxPbDqR7uMEhfJQNtOgLJhUeNE0nos5uh3ebgIW/QiwSaXKa7Os2R4ThtPO Jv0AXMAWwXxg2j9sT2R/ZZ3tLNQSAMf1psadVFnYl+tbK0fl80/P+I+L8wHtvVkgVI+/ Av7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=PzkBa+m5T1oOyM+GLvf9oIXRu5HH5HPNs81Hb7qEfqM=; b=phos3yGli33JEAFSpr5eyL98m1qcK/SP/wOPPjxfCNnGAJok/85ilpjZpea9ycTkfF iKlwDqbp+V4VE4mBTje4ELl53rg80EB1r8wJZrsTQIyzjfeTfF+A5caJEoOw7CPaK8O1 Z0GO43QTAlXOJx1TyVPg8LIuXdKjzMfvbrhwwKDSe2qE/hnyxKbEzd9U4M4o240MdwqM +buFN91HmC3Hhj3AsK9UfXw5D1UqP0B60W/XLf01wLo36MDm7db0obtZpQlzJ/6fNnGE 450uaHK4IPHW2EauhLG+nhqUKOtBRypwrvKrz9gBgeX0IYTqTovpNk7wQf0pwRPCh+IC I3Dg== X-Gm-Message-State: ABuFfohV+1+psygB3gD76tzHx9vvEQTOjuIgsM6RleXxKhs5tud2MT3+ TB0w7w5dvictHtYntkekwxwQoKzXa1U= X-Google-Smtp-Source: ACcGV60d9ce4lLcioftayZT8/B9nAEbqSineIh+4ubJ3GiYPtrH4LESl5DzactX9MyA4XA+4M3OTtw== X-Received: by 2002:ac8:47cf:: with SMTP id d15-v6mr19489351qtr.82.1539003267613; Mon, 08 Oct 2018 05:54:27 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id 3-v6sm10654625qky.6.2018.10.08.05.54.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Oct 2018 05:54:27 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 90ED26D8; Mon, 8 Oct 2018 09:54:25 -0300 (-03) Date: Mon, 8 Oct 2018 09:54:25 -0300 From: Alvaro Herrera To: Michael Paquier Cc: Postgres hackers Subject: Re: pgsql: Fix event triggers for partitioned tables Message-ID: <20181008125425.ims7ibk4pefwmg7q@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181008091258.GC2754@paquier.xyz> User-Agent: NeoMutt/20180716 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2018-Oct-08, Michael Paquier wrote: > Hi Alvaro, > > On Sat, Oct 06, 2018 at 10:18:46PM +0000, Alvaro Herrera wrote: > > Fix event triggers for partitioned tables > > > > Index DDL cascading on partitioned tables introduced a way for ALTER > > TABLE to be called reentrantly. This caused an an important deficiency > > in event trigger support to be exposed: on exiting the reentrant call, > > the alter table state object was clobbered, causing a crash when the > > outer alter table tries to finalize its processing. Fix the crash by > > creating a stack of event trigger state objects. There are still ways > > to cause things to misbehave (and probably other crashers) with more > > elaborate tricks, but at least it now doesn't crash in the obvious > > scenario. > > This commit is producing a warning with my compiler: > event_trigger.c:1764:9: note: in expansion of macro ‘OidIsValid’ > Assert(OidIsValid(currentEventTriggerState->currentCommand)); > > The fix is obvious because currentCommand is a pointer and not an Oid. > Please see attached. Should I fix it myself? If you have a commit ready, please do, thanks. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services