Skip site navigation (1) Skip section navigation (2)

Re: Proposed patch - psql wraps at window width

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Bryce Nesbitt <bryce2(at)obviously(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org, heikki(at)enterprisedb(dot)com
Subject: Re: Proposed patch - psql wraps at window width
Date: 2008-04-21 15:29:05
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches
Bryce Nesbitt wrote:
> 1) "\pset columns XX" should make it clear that's for file output only.

OK, docs updated.

> 2) There's an extra space, which breaks \pset border 2
> 717c717
> <                                       fputc(' ', fout);;
> ---
>  >                                       fputc(' ', fout);
> 842c842
> <                                       fputs(" | ", fout);
> ---
>  >                                       fputs(" |", f

OK, got them fixed.

> 2) With \pset border 2, the far left border, for symmetry, should work 
> like the middle borders.

OK, how does it look now with this patch?

> 3) I'm getting bolder: how about having \pset format wrapped as the 
> default?  Any downsides?

I think we are going to want it as the default for many psql
informational commands, like \df.  Not sure about a more general
default.  We were just discussing using \x as a default for wide output
but it seems this wrap style is probably a better solution than
switching for \x for wide columns (less distracting for the user and
cleaner).  That will have to be a separate discussion once we are done.

Oh, I found a problem in my coding of the new wrap function I added. 
While I handled the case where a character might span multiple bytes, I
assumed all characters had a display width of one.  You can see from
pg_wcsformat()'s use of PQdsplen() that this isn't always the case. I
have modified the patch to properly use PQdsplen() but we are going to
need multi-byte users to test this once we are done.

  Bruce Momjian  <bruce(at)momjian(dot)us>

  + If your life is a hard drive, Christ can be your backup. +

Attachment: /pgpatches/wrap
Description: text/x-diff (32.2 KB)

In response to


pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2008-04-21 15:38:58
Subject: Re: Commitfest namespacing (was: TODO, FAQs to Wiki?)
Previous:From: Chris BrowneDate: 2008-04-21 15:25:38
Subject: Re: TODO, FAQs to Wiki?

pgsql-patches by date

Next:From: Bruce MomjianDate: 2008-04-21 15:40:17
Subject: Re: Testing pg_terminate_backend()
Previous:From: Bruce MomjianDate: 2008-04-21 15:19:03
Subject: Re: Proposed patch - psql wraps at window width

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group