diff --git a/src/tools/pgindent/pgindent b/src/tools/pgindent/pgindent
index 2d81672e15..10cd8ee4ff 100755
--- a/src/tools/pgindent/pgindent
+++ b/src/tools/pgindent/pgindent
@@ -274,8 +274,14 @@ sub run_indent
 {
 	my $source        = shift;
 	my $error_message = shift;
+	my $is_header     = shift;
+	my $options       = $indent_opts;
 
-	my $cmd = "$indent $indent_opts -U" . $filtered_typedefs_fh->filename;
+	if ($is_header) {
+		$options .= " -npsl";
+	}
+
+	my $cmd = "$indent $options -U" . $filtered_typedefs_fh->filename;
 
 	my $tmp_fh = new File::Temp(TEMPLATE => "pgsrcXXXXX");
 	my $filename = $tmp_fh->filename;
@@ -431,10 +437,11 @@ foreach my $source_filename (@files)
 	my $source        = read_source($source_filename);
 	my $orig_source   = $source;
 	my $error_message = '';
+	my $is_header     = ($source_filename =~ m/\.h$/);
 
 	$source = pre_indent($source);
 
-	$source = run_indent($source, \$error_message);
+	$source = run_indent($source, \$error_message, $is_header);
 	if ($source eq "")
 	{
 		print STDERR "Failure in $source_filename: " . $error_message . "\n";
