Re: Add support for logging the current role - Mailing list pgsql-hackers
From | Stephen Frost |
---|---|
Subject | Re: Add support for logging the current role |
Date | |
Msg-id | 20110211150229.GF4116@tamriel.snowman.net Whole thread Raw |
In response to | Re: Add support for logging the current role (Robert Haas <robertmhaas@gmail.com>) |
Responses |
Re: Add support for logging the current role
|
List | pgsql-hackers |
* Robert Haas (robertmhaas@gmail.com) wrote: > I don't think it's entirely stupid to worry about this completely > screwing up the output of "SHOW ALL" on people using 80-character > terminal windows. I haven't checked, but if it renders the output > totally unreadable then I think we should try to find an alternative > that doesn't. Alright, so I looked into this a bit and have a couple of comments: show all; output, at least on my test rig, is *already* well over 80-characters wide. The longest GUC is max_predicate_locks_per_transaction, which forces the first column to be 38 columns. We then have some rather long descriptions (which are only shown on show all, no clue why that is..), the longest being "Sets whether XML data in implicit parsing and serialization operations is to be considered as documents or content fragments." (for xmloption). Now, it's true that the longest default *setting* w/ this patch is the list of CSV fields, but it's not like 'show all;' really works that well on an 80-character terminal today. The second longest setting, on my system, is the path to postgresql.conf: /data/sfrost/pgsql/test/data/postgresql.conf That, plus the length of max_predicate_locks_per_transaction, would make 'show all;' go beyond 80 characters even if we took out the description (but we don't currently support that..). This new option *would* make a query against an individual 'show <name>;' return, in the default configuration, a value longer than 80-characters, but we're just talking 1 row being returned there. My feeling is that this could be improved by supporting multi-line configuration settings, and then changing the longer descriptions to be multi-line, but that still wouldn't get us down to 80-characters due to the combination of max_predicate_locks_per_transaction and config_file. Renaming a configuration option isn't exactly a trivial thing to do either. :/ One thing that would be nice, but probably non-trivial, would be to allow "show all;" to be a subselect, so you could do things like, I dunno, pull the max length of certain columns. :) We could also have a 'show all;' which just returns the name and setting and then a 'show all verbose;' for including the description, or a 'show verbose <name>;' for getting all three fields when looking at a specific variable. All-in-all, I think we're past the point of being able to make show all; fit completely on an 80-character terminal, even in \x mode. I'd be willing to work on the multi-line stuff for 9.2, if people are really interested in it, but I don't think not having that should be a show-stopper for this patch, and I think that would be more likely to break client applications than this change.. Thanks, Stephen
pgsql-hackers by date: