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 1nXBw4-0004uE-2f for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Mar 2022 01:06:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nXBw2-0003Vi-Dj for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Mar 2022 01:06:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXBw2-0003RR-3k for pgsql-hackers@lists.postgresql.org; Thu, 24 Mar 2022 01:06:42 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXBvz-0007d5-QA for pgsql-hackers@postgresql.org; Thu, 24 Mar 2022 01:06:41 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 926CE32006F2; Wed, 23 Mar 2022 21:06:38 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 23 Mar 2022 21:06:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; bh=Z9lzUxNKaXAI8Y5kspqSCTzpOPoyUc9ywezNmZ /9Bm0=; b=x1DvR1fbt4ucH/5z2QfmpTYr5LF/onvPnHYWVjo31kdrU4pevGr2o7 Qk4+5FL0iE73t8h1isD2QtmOKNUbtUyfwjD9Pug3RY/qcSZ5VBCN1IYZm269u/Vp BXK3LLBcl3BuAal2rFF6l6MmK92l0Abg2o44+Z0LkFoeyCsiPwAyAldhFK+C6Y/T mfiONRaBMg0Llml/IpbVCwwqIkGDljI0t9Mm2ThZuxkPLGQBNkFRqQqjqgKHrnjB jMyVlO6mPIzkB8zXeJAM2ZQaoXcHEHrRc4eOG9zam6RJh38Nkz3/lpyAZGIqdbua nAMU56aUHLfcnjcR4xIkHJaOeWlbUaJw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=Z9lzUxNKaXAI8Y5ks pqSCTzpOPoyUc9ywezNmZ/9Bm0=; b=JWGZUs5p442CCtYTyF1vZEn5zTG9qiW8H 0iE1DyzTcP/Bwpv+9c8oPQi2/Tk/05rbV6l+1hwQrDWmYCdofUWoB6wtwTdh8DUN e/oSQuthDzW57uNNN1Q4MeKuE+Z8EhORKqmfoCTMFHFQXDEqb3SDBaTljtXQYjG5 xVh8iUV64jnvRtgMHwjPJMTmu2XvFr9Z08oz+gpGkQVKZSMtZuQWfTePVLUfEtxC wANDTwy4cn0msptgke4VdWXMQUsf3sxsE0QamcpNJpj2MQFwZ9M0B+g6sV0BJ0gL JX1JBm+6LIQoteJuCbUFG+JPUudlVlZtYaFNmT2Raej/i/F26hjpg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudegkedgfeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffvuffkfhggtggujgfhsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrg htthgvrhhnpeekleehgeeuvdfhffeggeekgfetueeuleffvddvtdeiveegjeekjefgkeet vedvtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 23 Mar 2022 21:06:37 -0400 (EDT) Date: Wed, 23 Mar 2022 18:06:36 -0700 To: Thomas Munro Cc: Peter Eisentraut , David Christensen , Bharath Rupireddy , PostgreSQL-development Subject: Re: [PATCH] add relation and block-level filtering to pg_waldump Message-ID: <20220324010636.goeqehteid6tffgj@alap3.anarazel.de> [IFrom: Andres Freund References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: From: Andres Freund List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-03-24 11:54:15 +1300, Thomas Munro wrote: > Erm, is that really OK? C says "Each enumerated type shall be > compatible with char, a signed integer type, or an > unsigned integer type. The choice of type is implementation-defined, > but shall be capable of representing the values of all the members of > the enumeration." It could even legally vary from enum to enum, > though in practice most compilers probably just use ints all the time > unless you use weird pragma pack incantation. Therefore I think you > need an intermediate variable with the size and signedness matching the > format string, if you're going to scanf directly into it, which > David's V6 did. /me yearns for the perfectly reasonable C++ 11 feature of defining the base type for enums (enum name : basetype { }). One of those features C should have adopted long ago. Not that we could use it yet, given we insist that C standards have reached at least european drinking age before relying on them.