Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sz4wn-0043ZD-Qh for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Oct 2024 02:00:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sz4wm-00BRxQ-64 for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Oct 2024 02:00:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sz4wl-00BRxD-QT for pgsql-hackers@lists.postgresql.org; Fri, 11 Oct 2024 02:00:04 +0000 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sz4wi-000R83-Qm for pgsql-hackers@lists.postgresql.org; Fri, 11 Oct 2024 02:00:03 +0000 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2fadc95ccfcso16317621fa.1 for ; Thu, 10 Oct 2024 19:00:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728612001; x=1729216801; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Qfy5czZggt2hiIQLEujBTjq576ZGW2VEzXJXC2/LTCs=; b=XM1ALQAumeEH95kGkNTUD5vAxNSZ1x5juOdNApusTw0kRCmH8rOcZaTSYDRNPBbmy2 ZI7TB3d6+Kxc62TEIwxDqTePKmFtHx8Umm5sTh1BMDV4ltDCWhWkd6fpNi+yH0lrh/Lm s5l24wLSL1hMlly+cHxjBL1rgEkXtf6ceUhkxPn71MTvif4/Y/BjR85qNpuPjwphJUZc D03f4yXY+tVhk8mb4H0riE5nzMSkbLhXgU11upgNdXvolm0rIMZ0FEiHN5S72gN1xEqT PRkNcz9x9vDvr9+Y7nsquPoorMXPHhzDqVtZusy+D79LZZzBVb/PVAFvlQjRdURgrfOb bHcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728612001; x=1729216801; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Qfy5czZggt2hiIQLEujBTjq576ZGW2VEzXJXC2/LTCs=; b=XbZyt3iympjl+wMt6fG4GTI6WQxxlaymjFWmMRIcMtamYsQ0KFby/ayYW67WgKx3Xa kQAhtUPm4MplSUUrhwgJt9lJZpQ9JRMm/vAxsIfFwu0nVTO1pC4Uu+0eFGdr3/WmLM1J jdCe0Eu+QdxfUAkitjAaT7BRPscwjT9YcFrLSJPAOadQiWeiLejqbyW5fJQeghAcHja+ F49I3FPc+dFKhJTZGVf88SH8cN5atoe5VrrZYC7YEPpHtu1nwoM4tQkO3U8y98xot0xg R0o0zY8GWmVH5cC0ciES8LxTPmcfuP9Sn9vN3PfYNLTiWNp5cXVUaSnbHeJBcWG8ZSNc sR8w== X-Forwarded-Encrypted: i=1; AJvYcCWMJZadwsdv9iIW4iV/PVYZiJVl1eoivoWMu/FtWQMN4X16A8l+CURHZRixJfxS7vz4Ta3Pos2O8Q99M6dB@lists.postgresql.org X-Gm-Message-State: AOJu0YzKICJef6MpzvZ7NoVgQ9IduYu3MTNz1+gPPxPSrp/DThsKXihY NP4/Pr7lk8H9wiPiNXECbUkqiC0CR3Ea6H8aYj4Kro3fkgM+vsxeDldjM4fCETfPLE2xjMRuzfq ZeFILKHMy9AEW/aSEsl45FfRhMIU= X-Google-Smtp-Source: AGHT+IEspEpBsUponPN8Ig7cn0wxzkoNP7Mh0aMqANYCUzdf9kPjxpANg+ye9DdmX3do4d6Y89SIKunUzonE5AHC7us= X-Received: by 2002:a2e:a99c:0:b0:2fa:f5f1:2542 with SMTP id 38308e7fff4ca-2fb32727f5dmr3542611fa.12.1728612000719; Thu, 10 Oct 2024 19:00:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Fri, 11 Oct 2024 12:59:33 +1100 Message-ID: Subject: Re: Add contrib/pg_logicalsnapinspect To: Bertrand Drouvot Cc: Masahiko Sawada , Peter Eisentraut , shveta malik , Amit Kapila , Bharath Rupireddy , pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, Here are a few comments for patch set v13* ////////// Patch v13-0001 ====== Commit message 1.1 /were no use case/was no use case/ ~~~ 1.2 It seemed a bit odd that the switch cases for 'construct_array_builtin' are not the same as those for 'deconstruct_array_builtin'. For example, all these ones seem missing from deconstruct: case INT4OID: case INT8OID: case NAMEOID: case REGTYPEOID: I know that has nothing to do with your patch, and I guess it does not cause any problems otherwise there would be ERRORs. But, if you are to follow this same current pattern, then perhaps you don't need to add your new case for 'deconstruct_array_builtin', since AFAICT you are never using it. ////////// Patch v13-0002 ====== pg_get_logical_snapshot_meta: 2.1 + Datum values[PG_GET_LOGICAL_SNAPSHOT_META_COLS]; + bool nulls[PG_GET_LOGICAL_SNAPSHOT_META_COLS]; FWIW, if you wanted to avoid a few lines you could initialise the nulls array during the declaration. bool nulls[PG_GET_LOGICAL_SNAPSHOT_META_COLS] = {0}; This seems a common pattern in other source code, and it replaces the need for the subsequent memset. ~~~ pg_get_logical_snapshot_info: 2.2 + Datum values[PG_GET_LOGICAL_SNAPSHOT_INFO_COLS]; + bool nulls[PG_GET_LOGICAL_SNAPSHOT_INFO_COLS]; Ditto of #2.1. You could instead just initialise in the declaration like: bool nulls[PG_GET_LOGICAL_SNAPSHOT_INFO_COLS] = {0}; ====== Kind Regards, Peter Smith. Fujitsu Australia