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 1pbm5C-0007lq-7f for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Mar 2023 17:35:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pbm5A-0003Xq-LF for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Mar 2023 17:35:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pbm5A-0003Xf-9n for pgsql-hackers@lists.postgresql.org; Mon, 13 Mar 2023 17:35:36 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pbm57-0001VX-8H for pgsql-hackers@lists.postgresql.org; Mon, 13 Mar 2023 17:35:35 +0000 Received: by mail-pl1-x62a.google.com with SMTP id k2so5922739pll.8 for ; Mon, 13 Mar 2023 10:35:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678728931; 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=8AYOhuGqaOyK+IGY89fCnC6Zq1u6HTnD1i35dh1c0GI=; b=phosLDPNAuoNY/aZw79U9d5xhe6GKUchaGedD8a1/YlHVMF2gJoEvcHzMPRU+MueXs VS2ldH+hZs/aWIJQ7/hSyP20kf4JwgKjO3rKnY3rDirPxleXpQyNH9rDaF6PKjv8OXYU DCvVu+1wIn/MqWjunX9VxX+dW9G8wN5WfXveXUzLVZf4FNjLJnHrFwfh9L3tMizfGQIX aoZn1ScQJYmqDZ7coxb7U47LFWIZbCeAHER1iZEMJwcQGiDEEn41xrl2ndzM+QrMZ+HI 9HR+4sGhdMbtC1gm8ZPs4OfxHkW8YVHsbKVx8tzRjUdX6LBlLAWoJq8OeUW5TBPpZrbC 79Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678728931; 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=8AYOhuGqaOyK+IGY89fCnC6Zq1u6HTnD1i35dh1c0GI=; b=3zxM03eg/NQK09dTndhuEIr7VIjRzaOaS3q1IKKop8R5uaKAI5y6XcXaqb5uk8/7pN pTiApV732cgXm6X8voXy+Buzp31fkpl5fE/P2SKAxu/xB9L5P4a7tPJ+RTXv9HKHOU6y EVIHqR7+ZV3tUikcdCfYVyUWiMCkvaTO7/uyM7ZKrrcNO2/SxDdU38pwa3pDkfQXRH55 Qkq+anzh8wjZ3Mqps+V/ulMgPiiV8n/0AQArvw7T5FITsyp7j+bd62pRBYYpmim/RLqm LrfDaqEEDEHfANJFm3vznM31G9FXkFHWjbplEL0SL5lsEzFaquigYciCFyDOZ2nSBYdh EyDA== X-Gm-Message-State: AO0yUKV/sDGQymVCSD/1w9mChAyGE3grUbZAQqxb9kyS5t8n+JuMX6H1 1WDiySelWGy2PSbnGY09ITs= X-Google-Smtp-Source: AK7set/eklbfGAlP/CSJwLih5fkSQEJq8dOhyxeP36fDWkDnlTA6lsyVwbWiyU4QA1nun9AYpqkOKA== X-Received: by 2002:a05:6a20:4f0f:b0:bc:32ff:9afb with SMTP id gi15-20020a056a204f0f00b000bc32ff9afbmr30777861pzb.44.1678728930867; Mon, 13 Mar 2023 10:35:30 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id k30-20020a635a5e000000b00502fd141ffbsm13114pgm.49.2023.03.13.10.35.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 10:35:30 -0700 (PDT) Date: Mon, 13 Mar 2023 10:35:28 -0700 From: Nathan Bossart To: Yurii Rashkovskii Cc: pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] Extend the length of BackgroundWorker.bgw_library_name Message-ID: <20230313173528.GA195204@nathanxps13> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Mar 13, 2023 at 07:57:47AM -0700, Yurii Rashkovskii wrote: > However, there are use cases where [potentially] longer names are > expected/desired; for example, test benches (where library files may not > [or can not] be copied to Postgres installation) or alternative library > installation methods that do not put them into $libdir. > > The patch is backwards-compatible and ensures that bgw_library_name stays > *at least* as long as BGW_MAXLEN. Existing external code that uses > BGW_MAXLEN is a length boundary (for example, in `strncpy`) will continue > to work as expected. I see that BGW_MAXLEN was originally set to 64 in 2013 (7f7485a) [0], but was increased to 96 in 2018 (3a4b891) [1]. It seems generally reasonable to me to increase the length of bgw_library_name further for the use-case you describe, but I wonder if it'd be better to simply increase BGW_MAXLEN again. However, IIUC bgw_library_name is the only field that is likely to be used for absolute paths, so only increasing that one to MAXPGPATH makes sense. [0] https://postgr.es/m/CA%2BTgmoYtQQ-JqAJPxZg3Mjg7EqugzqQ%2BZBrpnXo95chWMCZsXw%40mail.gmail.com [1] https://postgr.es/m/304a21ab-a9d6-264a-f688-912869c0d7c6%402ndquadrant.com -- Nathan Bossart Amazon Web Services: https://aws.amazon.com