initdb: Refactor PG_CMD_PUTS loops

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: initdb: Refactor PG_CMD_PUTS loops
Date: 2022-12-01 10:02:33
Message-ID: 2c50823b-f453-bb97-e38b-34751c51dcdf@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Attachment Content-Type Size
0001-initdb-Refactor-PG_CMD_PUTS-loops.patch text/plain 15.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message houzj.fnst@fujitsu.com 2022-12-01 10:16:58 RE: Perform streaming logical transactions by background workers and parallel apply
Previous Message Dean Rasheed 2022-12-01 09:55:12 Re: Improve performance of pg_strtointNN functions