From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Andrew Dunstan <andrew@dunslane.net>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: initdb: Refactor PG_CMD_PUTS loops
Date: Mon, 5 Dec 2022 23:40:54 +0100
Message-ID: <924d08b2-0fb0-a97e-2e2e-7c365ea42f0c@enterprisedb.com> (raw)
In-Reply-To: <962a4a82-ec18-6a4f-7002-4edb2a47b94c@dunslane.net>
References: <2c50823b-f453-bb97-e38b-34751c51dcdf@enterprisedb.com>
<962a4a82-ec18-6a4f-7002-4edb2a47b94c@dunslane.net>
On 02.12.22 15:07, Andrew Dunstan wrote:
> On 2022-12-01 Th 05:02, Peter Eisentraut wrote:
>> Keeping the SQL commands that initdb runs in string arrays before
>> feeding them to PG_CMD_PUTS() seems unnecessarily verbose and
>> inflexible. In some cases, the array only has one member. In other
>> cases, one might want to use PG_CMD_PRINTF() instead, to parametrize a
>> command, but that would require breaking up the loop or using
>> workarounds like replace_token(). This patch unwinds all that; it's
>> much simpler that way.
>
> Looks reasonable. (Most of this dates back to 2003/2004, the very early
> days of initdb.c.)
committed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: peter.eisentraut@enterprisedb.com, andrew@dunslane.net
Subject: Re: initdb: Refactor PG_CMD_PUTS loops
In-Reply-To: <924d08b2-0fb0-a97e-2e2e-7c365ea42f0c@enterprisedb.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox