diff --git a/src/bin/psql/create_help.pl b/src/bin/psql/create_help.pl
index c877a8d1d427ca692b556bbab039279683c74bc1..c5b0d8680656108e57a568a6dc1b602954d06277 100644
--- a/src/bin/psql/create_help.pl
+++ b/src/bin/psql/create_help.pl
@@ -46,7 +46,7 @@ struct _helpStruct
 static struct _helpStruct QL_HELP[] = {
 ";
 
-foreach $file (readdir DIR) {
+foreach $file (sort readdir DIR) {
     my ($cmdname, $cmddesc, $cmdsynopsis);
     $file =~ /\.sgml$/ || next;