"Peter Eisentraut" <[EMAIL PROTECTED]> writes: > Am Dienstag, 29. April 2008 schrieb Bruce Momjian: >> We do look at COLUMNS if the ioctl() fails, but not for file/pipe >> output. > > This is quite a useless complication. Readline uses exactly the same ioctl() > call to determine the columns, so if ioctl() were to fail, then COLUMNS would > be unset or wrong as well.
COLUMNS is just a regular environment variable. The user is free to set it and many people have dotfiles, aliases, or scripts which do just that. Consider, for example, someone with a cron job which runs several commands such as "ls -C", "dpkg -l", and of course "psql -Pformat=wrapped" to generate various reports and wants it all formatted to 72 columns. They would normally just set COLUMNS=72 and run their commands and get an email all formatted to 72 columns. But your point is valid, that's why I'm not too worried about cases where COLUMNS is set to the desired width but readline interferes with it. In those cases we would be using the ioctl value anyways. It would probably still be a good idea to getenv(COLUMNS) early on before readline is initialized though. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training! -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers