Skip to content

Commit 452427d

Browse files
committed
pg_char_to_encoding() was redundant in initdb because
pg_valid_server_encoding() returns the same result if the encoding is valid. ITAGAKI Takahiro
1 parent 31f0bac commit 452427d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/bin/initdb/initdb.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* Portions Copyright (c) 1994, Regents of the University of California
4343
* Portions taken from FreeBSD.
4444
*
45-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.135 2007/03/18 16:50:43 neilc Exp $
45+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.136 2007/03/29 22:46:42 momjian Exp $
4646
*
4747
*-------------------------------------------------------------------------
4848
*/
@@ -709,8 +709,7 @@ get_encoding_id(char *encoding_name)
709709

710710
if (encoding_name && *encoding_name)
711711
{
712-
if ((enc = pg_char_to_encoding(encoding_name)) >= 0 &&
713-
pg_valid_server_encoding(encoding_name) >= 0)
712+
if ((enc = pg_valid_server_encoding(encoding_name)) >= 0)
714713
return encodingid_to_string(enc);
715714
}
716715
fprintf(stderr, _("%s: \"%s\" is not a valid server encoding name\n"),

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy