initdb: Refactor PG_CMD_PUTS loops - Mailing list pgsql-hackers

From Peter Eisentraut
Subject initdb: Refactor PG_CMD_PUTS loops
Date
Msg-id 2c50823b-f453-bb97-e38b-34751c51dcdf@enterprisedb.com
Whole thread Raw
Responses Re: initdb: Refactor PG_CMD_PUTS loops  (John Naylor <john.naylor@enterprisedb.com>)
Re: initdb: Refactor PG_CMD_PUTS loops  (Andrew Dunstan <andrew@dunslane.net>)
List 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

pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: Improve performance of pg_strtointNN functions
Next
From: "houzj.fnst@fujitsu.com"
Date:
Subject: RE: Perform streaming logical transactions by background workers and parallel apply