Content-Length: 276736 | pFad | http://github.com/postgrespro/postgres/commit/452427d0fdc49aeb74711eabe0c6d9554d406089

D6 pg_char_to_encoding() was redundant in initdb because · postgrespro/postgres@452427d · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/452427d0fdc49aeb74711eabe0c6d9554d406089

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy