Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 463E62E00C7 for ; Mon, 3 Mar 2008 02:30:20 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 01795-02 for ; Mon, 3 Mar 2008 02:30:15 -0400 (AST) X-Greylist: delayed 00:10:46.942801 by SQLgrey-1.7.5 Received: from outA.internet-mail-service.net (outA.internet-mail-service.net [216.240.47.224]) by postgresql.org (Postfix) with ESMTP id 5238F2E00B3 for ; Mon, 3 Mar 2008 02:30:17 -0400 (AST) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Sun, 02 Mar 2008 22:19:29 -0800 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from [192.168.1.109] (adsl-71-135-191-42.dsl.pltn13.pacbell.net [71.135.191.42]) by idiom.com (Postfix) with ESMTP id EDD182D6010; Sun, 2 Mar 2008 22:19:27 -0800 (PST) Message-ID: <47CB98AB.1040807@obviously.com> Date: Sun, 02 Mar 2008 22:20:27 -0800 From: Bryce Nesbitt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080203 SUSE/1.1.8-0.1 SeaMonkey/1.1.8 MIME-Version: 1.0 To: pgsql-sql@postgresql.org, Tom Lane Subject: psql word wrapping to terminal width - testers? Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/3 X-Sequence-Number: 30331 I'm finishing up work on a version of the psql command line client that can can shrink columns until they fit in your terminal window. For example on 67 column ssh session... # \pset format aligned-wrapped # \pset border 2 # select * from distributors order by did; +------+--------------------+---------------------+---------------+ | did | name | descr | long_col_name | +------+--------------------+---------------------+---------------+ | 1 | Food fish and wine | default | | | 2 | Cat Food Heaven 2 | abcdefghijklmnopqrs ! | | | | tuvwxyz | | | 3 | Cat Food Heaven 3 | default | | | 4 | Cat Food Heaven 4 | default | | | 5 | Food Heaven | default | | | 10 | Lah | default | | | 12 | name | line one | | | 2892 ! short name | short | | | 8732 | | | | +------+--------------------+---------------------+---------------+ (8 rows) ...where columns 'descr' and 'did' each have a wrapped row. I'll send a postgres 8.4devel linux intel binary to anyone willing to try it out. I've got one painful edge case left to handle, but if it works well on various platforms, and others find it useful, I'd like to learn how and where to introduce it as a patch. Any tips are appreciated. This is intended to solve that annoying case where a few rows in a column are too long, blowing past the widest window you can fit onscreen. -Bryce Nesbitt