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 1t0ScL-00BYny-JP for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Oct 2024 21:28:41 +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 1t0ScJ-00HanA-QJ for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Oct 2024 21:28:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t0ScJ-00Han1-GD for pgsql-hackers@lists.postgresql.org; Mon, 14 Oct 2024 21:28:39 +0000 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t0ScH-000toE-Ew for pgsql-hackers@postgresql.org; Mon, 14 Oct 2024 21:28:38 +0000 Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-835393376e1so292608439f.1 for ; Mon, 14 Oct 2024 14:28:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728941316; x=1729546116; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=uypceAt09hw9j6mtmSJeiSW3gRJU14Xp4xhkACC2YP8=; b=XJVbfp2i/y/c9sAUW3az6s3Vb0v+LDR1R1x3rONnYVJzctPSdIrHtUF7I2OCqR7TnB c+lTFepPzQ+kY404j+WpSSHiBPwfoSh6VsrxY2iW9ozj+JA7GJKd8P25PALRbnNMv+41 oK++js9BEXTwsvaTFlBKOyRVNBGiuN09EaaozbLQqV2aeIlvZmxZaSyr0HoGisrLZ5ck M2C0/OXKJD2J8O8f4X/QZuRG0unh3dVu1CXkrAA1QBiK8ppiqqvo+CUVtXEZqViPhRzP X4EBKv0pJ+wSvNY9UM78MwClownL+JKI492qOII7uZLhB6y/PaGYbq/2ZH5ZxCQpCqNW oElw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728941316; x=1729546116; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=uypceAt09hw9j6mtmSJeiSW3gRJU14Xp4xhkACC2YP8=; b=YoaKyHBvrDUqoYrcTjRLT1AvYkLJaB5uXdmQksq0LCMAoLcZRsHvwdXyVTeQTuSCmW Uq8LZliKlf4SkYPUK1PCmKYF/ZtUH9eqRdMhhGlo5ZbQpgO7x2xAzLCR87+BLSP3fwBx lkEKMaAlhizrJmv+Dk7mLO62jBGIXicTbh8ujvm7T7QTCRRvARl9dYJAsviOFZ8Wy5is JbxEPU5IxLATvF+FKJQFzTaZcjnzP62PWXGYSEqMYBswx1gMUC65drNUGR2yHwmWehPN uUbCU8ggFTi3gHq5q9mjmx421LB9AlrRXN2+/3TNdoff0vov6rNmGXLB4ixxusLIRoJB aO+A== X-Gm-Message-State: AOJu0YzFiFWWl7Wi0US6blkndtq5cu0T7obrl6RImvbOq5qcb25PLI5n tbImGrnKebC3LDye7KHy7HqfsAMnmci7n2bxmjMwIJTNjfnNkNNg X-Google-Smtp-Source: AGHT+IHCIdRBqSPlfCzTFX54ZnuqrbAWQbLEWHEHK3cTCub1CZg2HqlBcVdiPBXGf2fslszVUBO21g== X-Received: by 2002:a05:6e02:1e07:b0:3a3:6b20:5e20 with SMTP id e9e14a558f8ab-3a3bcdcdfc4mr64393445ab.13.1728941316226; Mon, 14 Oct 2024 14:28:36 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4dbd2c7e34asm5988785173.84.2024.10.14.14.28.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 14:28:35 -0700 (PDT) Date: Mon, 14 Oct 2024 16:28:34 -0500 From: Nathan Bossart To: Peter Eisentraut Cc: pgsql-hackers Subject: Re: Improve node type forward reference Message-ID: References: <637eeea8-5663-460b-a114-39572c0f6c6e@eisentraut.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <637eeea8-5663-460b-a114-39572c0f6c6e@eisentraut.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Oct 14, 2024 at 09:47:59AM +0200, Peter Eisentraut wrote: > But we can do this better by using an incomplete struct, like > > struct Query *viewQuery ...; > > That way, everything has the correct type and fewer casts are required. This > technique is already used elsewhere in node type definitions. I noticed that the examples in parsenodes.h are for structs defined within the same file. If the struct is defined in a separate file, I guess you might need to include another header file wherever it is used, but that doesn't seem too bad. > The second patch just removes some more unnecessary casts around > copyObject() that I found while working on this. LGTM -- nathan