Re: Make message strings in fe-connect.c consistent - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Make message strings in fe-connect.c consistent
Date
Msg-id 3269965.1682051461@sss.pgh.pa.us
Whole thread Raw
In response to Make message strings in fe-connect.c consistent  (Gurjeet Singh <gurjeet@singh.im>)
Responses Re: Make message strings in fe-connect.c consistent  (Gurjeet Singh <gurjeet@singh.im>)
List pgsql-hackers
Gurjeet Singh <gurjeet@singh.im> writes:
> When reviewing a recently committed patch [1] I noticed the odd usage
> of a format specifier:

> +           libpq_append_conn_error(conn, "invalid %s value: \"%s\"",
> +                                   "load_balance_hosts",
> +                                   conn->load_balance_hosts);

> The oddity is that the first %s is unnecessary, since the value we
> want there is a constant. Typically a format specifier used to get the
> value stored in a variable.

This is actually intentional, on the grounds that it reduces the
number of format strings that require translation.

> There's just one exception to this pattern, though.

>> libpq_append_conn_error(conn, "invalid require_auth method: \"%s\"",
>> method);

Yup, this one did not get the memo.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Gurjeet Singh
Date:
Subject: Make message strings in fe-connect.c consistent
Next
From: Gurjeet Singh
Date:
Subject: Re: Make message strings in fe-connect.c consistent