Re: Invisible PROMPT2 - Mailing list pgsql-hackers

From Chapman Flack
Subject Re: Invisible PROMPT2
Date
Msg-id bbe78f8f-4d33-fb53-0210-5f994d759387@anastigmatix.net
Whole thread Raw
In response to Re: Invisible PROMPT2  (David Fetter <david@fetter.org>)
List pgsql-hackers
On 11/13/19 12:49 PM, David Fetter wrote:
>> Or just define %w as meaning "whitespace of the same width as
>> PROMPT1".  You couldn't use it *in* PROMPT1, then, but I see
>> no use-case for that anyway.
> 
> +1 for doing it this way.  Would it make more sense to error out if
> somebody tried to set that in PROMPT1, or ignore it, or...?

Define it as "difference between PROMPT1's width and the total width
of non-%w elements in this prompt". Then it has a defined meaning in
PROMPT1 too (which could be arbitrary if it appears only once, but
has to be zero in case it appears more than once).

Easter egg: expand it to backspaces if used in PROMPT2 among other
stuff that's already wider than PROMPT1. ;)

Regards,
-Chap



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [PATCH] Improve AtSubCommit_childXids
Next
From: Mark Dilger
Date:
Subject: Re: Using multiple extended statistics for estimates