psql -l doesn't process psqlrc.  Historically, this was probably not
useful, hence no one cared.  But with the linestyle option it's useful.
So I propose the attached tweak.

diff --git i/src/bin/psql/startup.c w/src/bin/psql/startup.c
index 4f3815a..10713e9 100644
--- i/src/bin/psql/startup.c
+++ w/src/bin/psql/startup.c
@@ -224,8 +224,12 @@ main(int argc, char *argv[])
 
 	if (options.action == ACT_LIST_DB)
 	{
-		int			success = listAllDbs(false);
+		int			success;
 
+		if (!options.no_psqlrc)
+			process_psqlrc(argv[0]);
+
+		success = listAllDbs(false);
 		PQfinish(pset.db);
 		exit(success ? EXIT_SUCCESS : EXIT_FAILURE);
 	}
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to