psql -l doesn't process psqlrc

Started by Peter Eisentrautalmost 15 years ago2 messages
#1Peter Eisentraut
peter_e@gmx.net
1 attachment(s)

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.

Attachments:

psql-l-psqlrc.patchtext/x-patch; charset=UTF-8; name=psql-l-psqlrc.patchDownload
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);
 	}
#2Robert Haas
robertmhaas@gmail.com
In reply to: Peter Eisentraut (#1)
Re: psql -l doesn't process psqlrc

On Sun, Feb 13, 2011 at 7:52 AM, Peter Eisentraut <peter_e@gmx.net> wrote:

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.

As a violent hater of the new linestyle, +1 from me.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company