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 1v3ZyT-000dvt-Jd for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Sep 2025 13:00:57 +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 1v3ZyR-009oxh-Go for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Sep 2025 13:00:56 +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 1v3ZyR-009oxZ-80 for pgsql-hackers@lists.postgresql.org; Tue, 30 Sep 2025 13:00:55 +0000 Received: from mail-qv1-xf2f.google.com ([2607:f8b0:4864:20::f2f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v3ZyP-000u0v-0F for pgsql-hackers@postgresql.org; Tue, 30 Sep 2025 13:00:55 +0000 Received: by mail-qv1-xf2f.google.com with SMTP id 6a1803df08f44-7970e8d1cfeso70203436d6.1 for ; Tue, 30 Sep 2025 06:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1759237251; x=1759842051; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Hu9HmeJTP1X4VYO8GWYhi7+0CUt2J8OqD9SCVysPoqU=; b=R2j1oupptHYw2Z9GleEHhPjl3GajtOv2BAn8BUqmWUmmOQ0iSnHj4n8HGJ43TeuVph z3p8v+x1PMbYRvWoN5Ot9etfzT0rmLDySdEK/XgyZ0674YMO0/r1J7ufOiKMy6tyUXeJ ls/MDuwa7Cr5uEqFCM06bUCTbanNOoWyJ97tFS3NGnDoRGDkl5WH5U+7/bbVxogwKHPT cqLhCvP0G2GlYvxhndR38mVgBgEDSyI202CkNZR7k2Mmh1BbupDGUMuB4wfdrAC/lQ1M HSJfFYfNFTtHETppYg5SIFnww4ZQydiUW32hcki1LI5JyN1O0yjVk7+19vie07R37XIj XR8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759237251; x=1759842051; h=content-transfer-encoding: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=Hu9HmeJTP1X4VYO8GWYhi7+0CUt2J8OqD9SCVysPoqU=; b=wn6yZ1yQ/qu/eqnvPUSQ90Ge3EMM10AYuV8FHWZrsq8XY+UPPZH0+MGATyDvtVJsIz kkELfZj87uetQixofuM56VBN9JC9ivsrnAmglZJmfBmhY9WADJz1ReTtozXGK13WbwLq 3cX4AtljEQYgpv0S+TW8nJuxjvFpLDpwex4ESC4TOuHGkgC4kSyw1g8wGc595lDjE0xi WmXEaUvOfm9R0CHPWozTYtolUq+5YkufEGvWq9oPxpEwaD9qGr2krOB3Fxho3y/78PFV TbyZu16jVHKly0+gnu8dj5n+T1UB3JzJvKDsciePDoRHphxylJK2LDUf/I3H6hnJtUR1 EYsg== X-Gm-Message-State: AOJu0YwXdSof3fT/EZvxGRIgp/DKwDqjkgSvE0uEyi5h8+dWAsNZmmxg cMp53mGyIHTvrDD4DRlfLpOzDGEU3bJYMD1ySurwKtsXyxmpWhGCrk68XXtaFWPc9/VB0YhdkfF JK2YCiGpeJJ4C9TgGJ3xdH8uv4Ud+3A== X-Gm-Gg: ASbGnctzwKwb61y71USYp4rVelEYugT9JV6zZ+kMht7WR4+8rzZRI5yLKoiRL41ehkU bcJUdf/2RFB6BgSWrn0MQGRZDA/kKOWlM1YxY11MhJgONktgbv9HjxPj2g9fd1wm3rRmKzMECdl hbX6v0gGRrzXDuKXbaq3q0TegLR8l+k9gIcFKbODklI03BFAIx2fUuH+vN3VaDr8MWyVNnEpJqv DzCxdsj66XS2AlDbBFEMyrBw7QA9JDi8UUqYjhEZw== X-Google-Smtp-Source: AGHT+IGeUgouZhRqcjHFIzLzR18UZDb7PIT6VNlTu/8tjwl/r7C++3ljCL1yKK7MKsFl0iUJxgN0okbkI5daWbAmwW4= X-Received: by 2002:a05:6214:e45:b0:781:d5c3:2328 with SMTP id 6a1803df08f44-7fc400b2c86mr239460266d6.55.1759237250705; Tue, 30 Sep 2025 06:00:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Shinya Kato Date: Tue, 30 Sep 2025 22:00:13 +0900 X-Gm-Features: AS18NWAhqe-pHOdiOuNFfvp1MnFjnqWYJpJ8dQLkx2PTjRWnYcES35nQys9yF6w Message-ID: Subject: Re: remove unnecessary include in src/backend/commands/policy.c To: jian he Cc: PostgreSQL-development Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Sun, Sep 14, 2025 at 3:38=E2=80=AFPM jian he wrote: > > hi. > > in src/backend/commands/policy.c, i found that > #include "access/htup.h" > #include "access/htup_details.h" > #include "catalog/catalog.h" > #include "nodes/pg_list.h" > #include "parser/parse_node.h" > #include "utils/array.h" > > is not necessary "include", so I removed it. > > we can also remove > #include "access/relation.h" > replace relation_open to table_open, since we already did relkind check i= n > RangeVarCallbackForPolicy. Thanks for the patch! I can confirm that it builds successfully and passes the regression tests. However, the changes make policy.c rely on transitive includes. For example, policy.c uses GETSTRUCT(), which is defined in access/htup_details.h. Instead of being included directly, that header is currently pulled in via a fairly long chain: catalog/indexing.h -> nodes/execnodes.h -> access/tupconvert.h -> executor/tuptable.h -> access/htup_details.h While this works for now, the dependency is fragile and could break if header files are rearranged in the future. I'm not sure this is a good practice, and although I couldn't find a specific rule against it in PostgreSQL's coding conventions, it seems risky. --=20 Best regards, Shinya Kato NTT OSS Center