diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c
index 8958903..319ec65 100644
--- a/src/bin/psql/print.c
+++ b/src/bin/psql/print.c
@@ -614,6 +614,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout, bool is_pager)
 	printTextLineWrap *wrap;	/* Wrap status for each column */
 	int			output_columns = 0;		/* Width of interactive console */
 	bool		is_local_pager = false;
+	bool		is_explain;
 
 	if (cancel_pressed)
 		return;
@@ -814,11 +815,14 @@ print_aligned_text(const printTableContent *cont, FILE *fout, bool is_pager)
 		}
 	}
 
+	is_explain = cont->ncolumns == 1 &&
+	  strcmp(cont->headers[0], "QUERY PLAN") == 0;
+
 	/*
 	 * If in expanded auto mode, we have now calculated the expected width, so
 	 * we can now escape to vertical mode if necessary.
 	 */
-	if (cont->opt->expanded == 2 && output_columns > 0 &&
+	if (cont->opt->expanded == 2 && output_columns > 0 && !is_explain &&
 		(output_columns < total_header_width || output_columns < width_total))
 	{
 		print_aligned_vertical(cont, fout, is_pager);
