Thread: new unicode table border styles for psql

new unicode table border styles for psql

From
Pavel Stehule
Date:
Hello

I wrote new styles for  psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting for final presentation.

Do you think so this feature is generally interesting and should be in core?

Regards

Pavel

Re: new unicode table border styles for psql

From
Szymon Guz
Date:
On 21 November 2013 08:09, Pavel Stehule <pavel.stehule@gmail.com> wrote:
Hello

I wrote new styles for  psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting for final presentation.

Do you think so this feature is generally interesting and should be in core?

Regards

Pavel

YES!

- Szymon

Re: new unicode table border styles for psql

From
amul sul
Date:
>YES!

+1



Re: new unicode table border styles for psql

From
Pavel Stehule
Date:
So here is patch for 9.4

7 new line styles, 2 new border styles, \pset border autocomplete

Regards

Pavel




2013/11/21 Szymon Guz <mabewlun@gmail.com>
On 21 November 2013 08:09, Pavel Stehule <pavel.stehule@gmail.com> wrote:
Hello

I wrote new styles for  psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting for final presentation.

Do you think so this feature is generally interesting and should be in core?

Regards

Pavel

YES!

- Szymon

Attachment

Re: new unicode table border styles for psql

From
Szymon Guz
Date:



On 21 November 2013 20:20, Pavel Stehule <pavel.stehule@gmail.com> wrote:
So here is patch for 9.4

7 new line styles, 2 new border styles, \pset border autocomplete

Regards

Pavel




2013/11/21 Szymon Guz <mabewlun@gmail.com>
On 21 November 2013 08:09, Pavel Stehule <pavel.stehule@gmail.com> wrote:
Hello

I wrote new styles for  psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting for final presentation.

Do you think so this feature is generally interesting and should be in core?

Regards

Pavel

YES!

- Szymon


That's pretty cool, I'd love to see it in the core, however it doesn't contain any documentation, so I'm afraid it will be hard to use for people.

thanks,
Szymon

Re: new unicode table border styles for psql

From
Szymon Guz
Date:
On 21 November 2013 21:15, Szymon Guz <mabewlun@gmail.com> wrote:



On 21 November 2013 20:20, Pavel Stehule <pavel.stehule@gmail.com> wrote:
So here is patch for 9.4

7 new line styles, 2 new border styles, \pset border autocomplete

Regards

Pavel




2013/11/21 Szymon Guz <mabewlun@gmail.com>
On 21 November 2013 08:09, Pavel Stehule <pavel.stehule@gmail.com> wrote:
Hello

I wrote new styles for  psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting for final presentation.

Do you think so this feature is generally interesting and should be in core?

Regards

Pavel

YES!

- Szymon


That's pretty cool, I'd love to see it in the core, however it doesn't contain any documentation, so I'm afraid it will be hard to use for people.

thanks,
Szymon

Hi Pavel,
I've found two errors in the documentation at http://postgres.cz/wiki/Pretty_borders_in_psql

1)

The unicode-double5 style looks like:

x=# select * from t;
┌───┬───┬───┐
│ a │ b │ t │
╞═══╪═══╪═══╡
│ 1 │ 1 │ a │
├───┼───┼───┤
│ 2 │ 2 │ b │
├───┼───┼───┤
│ 3 │ 3 │ c │
└───┴───┴───┘
(3 rows)

(There are horizontal lines between rows)

2) There is no unicode-double6 in psql, however it exists on the website.

regards,
Szymon

Re: new unicode table border styles for psql

From
Pavel Stehule
Date:

I should to appen list of new styles to doc. Style double6 doesnt exist, because I renamed double5 to bold1 (and created second bold2)

I will update patch tomorrow - it will be in cf4

Regards

Pavel

Dne 21.11.2013 21:37 "Szymon Guz" <mabewlun@gmail.com> napsal(a):
On 21 November 2013 21:15, Szymon Guz <mabewlun@gmail.com> wrote:



On 21 November 2013 20:20, Pavel Stehule <pavel.stehule@gmail.com> wrote:
So here is patch for 9.4

7 new line styles, 2 new border styles, \pset border autocomplete

Regards

Pavel




2013/11/21 Szymon Guz <mabewlun@gmail.com>
On 21 November 2013 08:09, Pavel Stehule <pavel.stehule@gmail.com> wrote:
Hello

I wrote new styles for  psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting for final presentation.

Do you think so this feature is generally interesting and should be in core?

Regards

Pavel

YES!

- Szymon


That's pretty cool, I'd love to see it in the core, however it doesn't contain any documentation, so I'm afraid it will be hard to use for people.

thanks,
Szymon

Hi Pavel,
I've found two errors in the documentation at http://postgres.cz/wiki/Pretty_borders_in_psql

1)

The unicode-double5 style looks like:

x=# select * from t;
┌───┬───┬───┐
│ a │ b │ t │
╞═══╪═══╪═══╡
│ 1 │ 1 │ a │
├───┼───┼───┤
│ 2 │ 2 │ b │
├───┼───┼───┤
│ 3 │ 3 │ c │
└───┴───┴───┘
(3 rows)

(There are horizontal lines between rows)

2) There is no unicode-double6 in psql, however it exists on the website.

regards,
Szymon

Re: new unicode table border styles for psql

From
Merlin Moncure
Date:
On Thu, Nov 21, 2013 at 1:09 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> Hello
>
> I wrote new styles for  psql table borders.
>
> http://postgres.cz/wiki/Pretty_borders_in_psql
>
> This patch is simply and I am think so some styles can be interesting for
> final presentation.
>
great. hm, maybe we could integrate color? (see:
http://merlinmoncure.blogspot.com/2012/09/psql-now-with-splash-of-color.html).

merlin



Re: new unicode table border styles for psql

From
Peter Eisentraut
Date:
On 11/21/13, 2:09 AM, Pavel Stehule wrote:
> Hello
> 
> I wrote new styles for  psql table borders.
> 
> http://postgres.cz/wiki/Pretty_borders_in_psql
> 
> This patch is simply and I am think so some styles can be interesting
> for final presentation.
> 
> Do you think so this feature is generally interesting and should be in core?

Maybe make the border setting a string containing the various characters
by index.  Then everyone can create their own crazy borders.




Re: new unicode table border styles for psql

From
Andrew Dunstan
Date:
On 11/21/2013 04:39 PM, Peter Eisentraut wrote:
> On 11/21/13, 2:09 AM, Pavel Stehule wrote:
>> Hello
>>
>> I wrote new styles for  psql table borders.
>>
>> http://postgres.cz/wiki/Pretty_borders_in_psql
>>
>> This patch is simply and I am think so some styles can be interesting
>> for final presentation.
>>
>> Do you think so this feature is generally interesting and should be in core?
> Maybe make the border setting a string containing the various characters
> by index.  Then everyone can create their own crazy borders.
>


Why not just reinvent termcap / terminfo? :-)

cheers

andrew




Re: new unicode table border styles for psql

From
Pavel Stehule
Date:
Hello


2013/11/21 Peter Eisentraut <peter_e@gmx.net>
On 11/21/13, 2:09 AM, Pavel Stehule wrote:
> Hello
>
> I wrote new styles for  psql table borders.
>
> http://postgres.cz/wiki/Pretty_borders_in_psql
>
> This patch is simply and I am think so some styles can be interesting
> for final presentation.
>
> Do you think so this feature is generally interesting and should be in core?

Maybe make the border setting a string containing the various characters
by index.  Then everyone can create their own crazy borders.


I seriously though about it, but not sure if it is good way.

- So we still have to deliver some basic set of styles still. 
- People prefer prefabricate solution with simply activation now - so customization use only a few  people
- buitin style requires about 110 bytes and it is safe and verified, dynamic styling requires some parser, maybe some other checks

So for this use case I prefer very primitive (and simple) design as was proposed.

Regards

Pavel
 

Re: new unicode table border styles for psql

From
Pavel Stehule
Date:
Hello


2013/11/21 Merlin Moncure <mmoncure@gmail.com>
On Thu, Nov 21, 2013 at 1:09 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> Hello
>
> I wrote new styles for  psql table borders.
>
> http://postgres.cz/wiki/Pretty_borders_in_psql
>
> This patch is simply and I am think so some styles can be interesting for
> final presentation.
>
great. hm, maybe we could integrate color? (see:
http://merlinmoncure.blogspot.com/2012/09/psql-now-with-splash-of-color.html).

it is next possible enhancing - I would to go forward in small steps, please :)

minimally (and independent on proposed patch) we can introduce some like "final regexp filtering"  - that can be used for this or other purposes.

Regards

Pavel
 



merlin

Re: new unicode table border styles for psql

From
Pavel Stehule
Date:



2013/11/21 Szymon Guz <mabewlun@gmail.com>
On 21 November 2013 21:15, Szymon Guz <mabewlun@gmail.com> wrote:



On 21 November 2013 20:20, Pavel Stehule <pavel.stehule@gmail.com> wrote:
So here is patch for 9.4

7 new line styles, 2 new border styles, \pset border autocomplete

Regards

Pavel




2013/11/21 Szymon Guz <mabewlun@gmail.com>
On 21 November 2013 08:09, Pavel Stehule <pavel.stehule@gmail.com> wrote:
Hello

I wrote new styles for  psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting for final presentation.

Do you think so this feature is generally interesting and should be in core?

Regards

Pavel

YES!

- Szymon


That's pretty cool, I'd love to see it in the core, however it doesn't contain any documentation, so I'm afraid it will be hard to use for people.

thanks,
Szymon

Hi Pavel,
I've found two errors in the documentation at http://postgres.cz/wiki/Pretty_borders_in_psql

1)

The unicode-double5 style looks like:

x=# select * from t;
┌───┬───┬───┐
│ a │ b │ t │
╞═══╪═══╪═══╡
│ 1 │ 1 │ a │
├───┼───┼───┤
│ 2 │ 2 │ b │
├───┼───┼───┤
│ 3 │ 3 │ c │
└───┴───┴───┘
(3 rows)

(There are horizontal lines between rows)

2) There is no unicode-double6 in psql, however it exists on the website.

website is related to patch for 9.3 (I add note there)

patch for 9.4 is fixed - and now with small doc

Regards

Pavel
 

regards,
Szymon

Attachment

Re: new unicode table border styles for psql

From
Merlin Moncure
Date:
On Fri, Nov 22, 2013 at 2:23 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> Hello
>
>
> 2013/11/21 Merlin Moncure <mmoncure@gmail.com>
>>
>> On Thu, Nov 21, 2013 at 1:09 AM, Pavel Stehule <pavel.stehule@gmail.com>
>> wrote:
>> > Hello
>> >
>> > I wrote new styles for  psql table borders.
>> >
>> > http://postgres.cz/wiki/Pretty_borders_in_psql
>> >
>> > This patch is simply and I am think so some styles can be interesting
>> > for
>> > final presentation.
>> >
>> great. hm, maybe we could integrate color? (see:
>>
>> http://merlinmoncure.blogspot.com/2012/09/psql-now-with-splash-of-color.html).
>
>
> it is next possible enhancing - I would to go forward in small steps, please
> :)
>
> minimally (and independent on proposed patch) we can introduce some like
> "final regexp filtering"  - that can be used for this or other purposes.

Yeah.  A per field regexp would do the trick.  As you have it, I like
Peter's idea best.  Being able to specify the various character codes
makes a lot of sense.

merlin



Re: new unicode table border styles for psql

From
Pavel Stehule
Date:



2013/11/22 Merlin Moncure <mmoncure@gmail.com>
On Fri, Nov 22, 2013 at 2:23 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> Hello
>
>
> 2013/11/21 Merlin Moncure <mmoncure@gmail.com>
>>
>> On Thu, Nov 21, 2013 at 1:09 AM, Pavel Stehule <pavel.stehule@gmail.com>
>> wrote:
>> > Hello
>> >
>> > I wrote new styles for  psql table borders.
>> >
>> > http://postgres.cz/wiki/Pretty_borders_in_psql
>> >
>> > This patch is simply and I am think so some styles can be interesting
>> > for
>> > final presentation.
>> >
>> great. hm, maybe we could integrate color? (see:
>>
>> http://merlinmoncure.blogspot.com/2012/09/psql-now-with-splash-of-color.html).
>
>
> it is next possible enhancing - I would to go forward in small steps, please
> :)
>
> minimally (and independent on proposed patch) we can introduce some like
> "final regexp filtering"  - that can be used for this or other purposes.

Yeah.  A per field regexp would do the trick.  As you have it, I like
Peter's idea best.  Being able to specify the various character codes
makes a lot of sense.

there is other issue - simply parser will be really user unfriendly, and user friendly parser will not by simply :(

have you some idea about input format?

Regards

Pavel
 

merlin

Re: new unicode table border styles for psql

From
Alvaro Herrera
Date:
Pavel Stehule escribió:

> 2013/11/21 Peter Eisentraut <peter_e@gmx.net>

> > Maybe make the border setting a string containing the various characters
> > by index.  Then everyone can create their own crazy borders.
> >
> I seriously though about it, but not sure if it is good way.

How about having a single "unicode" line style, and then have a
different \pset setting to determine exactly what chars to print?  This
wouldn't allow for programmability, but it seems better UI to me.
This proliferation of unicode line style names seems odd.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



Re: new unicode table border styles for psql

From
Merlin Moncure
Date:
On Fri, Nov 22, 2013 at 8:45 AM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> Pavel Stehule escribió:
>
>> 2013/11/21 Peter Eisentraut <peter_e@gmx.net>
>
>> > Maybe make the border setting a string containing the various characters
>> > by index.  Then everyone can create their own crazy borders.
>> >
>> I seriously though about it, but not sure if it is good way.
>
> How about having a single "unicode" line style, and then have a
> different \pset setting to determine exactly what chars to print?  This
> wouldn't allow for programmability, but it seems better UI to me.
> This proliferation of unicode line style names seems odd.

That makes sense to me, especially if you could pass escapes.

merlin



Re: new unicode table border styles for psql

From
Pavel Stehule
Date:



2013/11/22 Alvaro Herrera <alvherre@2ndquadrant.com>
Pavel Stehule escribió:

> 2013/11/21 Peter Eisentraut <peter_e@gmx.net>

> > Maybe make the border setting a string containing the various characters
> > by index.  Then everyone can create their own crazy borders.
> >
> I seriously though about it, but not sure if it is good way.

How about having a single "unicode" line style, and then have a
different \pset setting to determine exactly what chars to print?  This
wouldn't allow for programmability, but it seems better UI to me.
This proliferation of unicode line style names seems odd.

-1

After thinking I don't see any value for common user. Users like you, me, Merlin are able to parametrize output or patching source code.

Any parametrization expect some secure store, that will support exchange of styles. And it expect robust parser of unicode strings, or ascii strings with unicode escaped chars.

We cannot parse a escaped unicode chars now on client side, and cost of parser is higher of benefit externally parametrized borders.

Regards

Pavel
 

--
Įlvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Re: new unicode table border styles for psql

From
Vik Fearing
Date:
On 11/21/2013 10:39 PM, Peter Eisentraut wrote:
> On 11/21/13, 2:09 AM, Pavel Stehule wrote:
>> I wrote new styles for  psql table borders.
>>
>> http://postgres.cz/wiki/Pretty_borders_in_psql
>>
>> This patch is simply and I am think so some styles can be interesting
>> for final presentation.
>>
>> Do you think so this feature is generally interesting and should be in core?
> Maybe make the border setting a string containing the various characters
> by index.  Then everyone can create their own crazy borders.

I vote for doing it this way.

We would provide a default setting, and the documentation would show
other examples.  Perhaps even set up a "repository" on a wiki page or
something.

-- 
Vik




Re: new unicode table border styles for psql

From
Dimitri Fontaine
Date:
Pavel Stehule <pavel.stehule@gmail.com> writes:
> there is other issue - simply parser will be really user unfriendly, and
> user friendly parser will not by simply :(

If simple things are hard to implement, get yourself better tools.

Each time we get on the topic of improving scripting abilities for our
interactive tool, it's always the same problem: having to invent a
scripting language with a whole parser is just too much work.

Maybe it's time we step back a little and consider real scripting
solutions to embed into psql, and pgbench too:
 http://ecls.sourceforge.net/         LGPL  Common Lisp http://www.gnu.org/software/guile/   LGPL  Scheme, Javascript,
EmacsLisp http://www.lua.org/                  MIT   Lua
 

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support



Re: new unicode table border styles for psql

From
Merlin Moncure
Date:
On Mon, Nov 25, 2013 at 3:33 AM, Dimitri Fontaine
<dimitri@2ndquadrant.fr> wrote:
> Pavel Stehule <pavel.stehule@gmail.com> writes:
>> there is other issue - simply parser will be really user unfriendly, and
>> user friendly parser will not by simply :(
>
> If simple things are hard to implement, get yourself better tools.
>
> Each time we get on the topic of improving scripting abilities for our
> interactive tool, it's always the same problem: having to invent a
> scripting language with a whole parser is just too much work.
>
> Maybe it's time we step back a little and consider real scripting
> solutions to embed into psql, and pgbench too:

I'm thinking (did I miss something?) that Pavel was commenting merely
on the parsing of setting unicode border characters, not the wider
scripting of psql.  (psql scripting is a fun topic to discuss though
:-)).

merlin



Re: new unicode table border styles for psql

From
Andrew Dunstan
Date:
On 11/25/2013 09:00 AM, Merlin Moncure wrote:
> On Mon, Nov 25, 2013 at 3:33 AM, Dimitri Fontaine
> <dimitri@2ndquadrant.fr> wrote:
>> Pavel Stehule <pavel.stehule@gmail.com> writes:
>>> there is other issue - simply parser will be really user unfriendly, and
>>> user friendly parser will not by simply :(
>> If simple things are hard to implement, get yourself better tools.
>>
>> Each time we get on the topic of improving scripting abilities for our
>> interactive tool, it's always the same problem: having to invent a
>> scripting language with a whole parser is just too much work.
>>
>> Maybe it's time we step back a little and consider real scripting
>> solutions to embed into psql, and pgbench too:
> I'm thinking (did I miss something?) that Pavel was commenting merely
> on the parsing of setting unicode border characters, not the wider
> scripting of psql.  (psql scripting is a fun topic to discuss though
> :-)).
>

Even if it is it's totally off topic. Please don't hijack email threads.


cheers

andrew



Re: new unicode table border styles for psql

From
Dimitri Fontaine
Date:
Andrew Dunstan <andrew@dunslane.net> writes:
> Even if it is it's totally off topic. Please don't hijack email threads.

Well, when I read that parsing a user setup is too complex, for me that
calls for a solution that offers more power to the user without us
having to write specialized code each time.

I'm sorry, but I don't understand how off-topic or hijack applies here.

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support



Re: new unicode table border styles for psql

From
Andrew Dunstan
Date:
On 11/25/2013 09:33 AM, Dimitri Fontaine wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>> Even if it is it's totally off topic. Please don't hijack email threads.
> Well, when I read that parsing a user setup is too complex, for me that
> calls for a solution that offers more power to the user without us
> having to write specialized code each time.
>
> I'm sorry, but I don't understand how off-topic or hijack applies here.
>



It just seems to me to be a very big stretch to go from the topic of 
psql border styles to the topic of psql scripting support. Your use case 
would surely be using a sledgehammer to crack a nut. By all means argue 
for better scripting support in psql, but I would suggest your argument 
would be better if the use case were something more important and 
central to psql's purpose.

cheers

andrew



Re: new unicode table border styles for psql

From
Dimitri Fontaine
Date:
Andrew Dunstan <andrew@dunslane.net> writes:
>> I'm sorry, but I don't understand how off-topic or hijack applies here.

And I just realize there's another way to read what Pavel said, which is
that *user scripts* parsing the output of psql might become harder to
write as soon as they don't control the default border style in use.

Well in that case, yes I'm vastly off-topic.

I was answering to how to parse the user setting itself, so writing C
code inside the psql source tree itself, and how to expose a fine
grained solution to that problem without having to write a whole new
configuration parser.

> It just seems to me to be a very big stretch to go from the topic of psql
> border styles to the topic of psql scripting support. Your use case would
> surely be using a sledgehammer to crack a nut. By all means argue for better
> scripting support in psql, but I would suggest your argument would be better
> if the use case were something more important and central to psql's purpose.

I think I just understood something entirely different that what you
were talking about.

-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support



Re: new unicode table border styles for psql

From
Pavel Stehule
Date:
sorry for offtopic


2013/11/25 Dimitri Fontaine <dimitri@2ndquadrant.fr>
Andrew Dunstan <andrew@dunslane.net> writes:
> Even if it is it's totally off topic. Please don't hijack email threads.

Well, when I read that parsing a user setup is too complex, for me that
calls for a solution that offers more power to the user without us
having to write specialized code each time.

I have a idea about sql shell with lua support - but probably as separate application and partially written in Lua. I have no plan to push scripting possibilities to psql.

Regards

Pavel
 

I'm sorry, but I don't understand how off-topic or hijack applies here.

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support

Re: new unicode table border styles for psql

From
Peter Eisentraut
Date:
On 11/22/13, 3:26 AM, Pavel Stehule wrote:
> website is related to patch for 9.3 (I add note there)
> 
> patch for 9.4 is fixed - and now with small doc

I think it would help if we considered the new border styles and the new
line styles separately.

I don't find the new border styles to be particularly useful.  They just
use up vertical screen space, which is usually more precious than
vertical space.  Is there a situation where you would find these styles
to be more useful than the existing ones?  Keep in mind that pset is
usually set permanently, so it wouldn't be practical to use a different
border style depending on how the query results shape up (like \x auto).

Now for the linestyles.  I can see how some of them are attractive, but
several of them have poor aesthetics, I think.  I don't see a reason to
accept 7 new styles just for fun.  If I had to choose, I'd consider
-double1 and -double4 to be acceptable.




Re: new unicode table border styles for psql

From
Pavel Stehule
Date:



2013/11/26 Peter Eisentraut <peter_e@gmx.net>
On 11/22/13, 3:26 AM, Pavel Stehule wrote:
> website is related to patch for 9.3 (I add note there)
>
> patch for 9.4 is fixed - and now with small doc

I think it would help if we considered the new border styles and the new
line styles separately.

I don't find the new border styles to be particularly useful.  They just
use up vertical screen space, which is usually more precious than
vertical space.  Is there a situation where you would find these styles
to be more useful than the existing ones?  Keep in mind that pset is
usually set permanently, so it wouldn't be practical to use a different
border style depending on how the query results shape up (like \x auto).

Now for the linestyles.  I can see how some of them are attractive, but
several of them have poor aesthetics, I think.  I don't see a reason to
accept 7 new styles just for fun.  If I had to choose, I'd consider
-double1 and -double4 to be acceptable.

+1

Pavel

Re: new unicode table border styles for psql

From
Pavel Stehule
Date:



2013/11/26 Pavel Stehule <pavel.stehule@gmail.com>



2013/11/26 Peter Eisentraut <peter_e@gmx.net>
On 11/22/13, 3:26 AM, Pavel Stehule wrote:
> website is related to patch for 9.3 (I add note there)
>
> patch for 9.4 is fixed - and now with small doc

I think it would help if we considered the new border styles and the new
line styles separately.

I don't find the new border styles to be particularly useful.  They just
use up vertical screen space, which is usually more precious than
vertical space.  Is there a situation where you would find these styles
to be more useful than the existing ones?  Keep in mind that pset is
usually set permanently, so it wouldn't be practical to use a different
border style depending on how the query results shape up (like \x auto).

Now for the linestyles.  I can see how some of them are attractive, but
several of them have poor aesthetics, I think.  I don't see a reason to
accept 7 new styles just for fun.  If I had to choose, I'd consider
-double1 and -double4 to be acceptable.

I am sending reduced patch

I add a double1, double4 and double5 - renamed to double1,double2, double3

support for border 3 and 4 removed

postgres=# \pset linestyle double1 \pset border 2 \l
Line style (linestyle) is double1.
Border style (border) is 2.
                                   List of databases
┌───────────┬──────────┬──────────┬─────────────┬─────────────┬───────────────────────┐
│   Name    │  Owner   │ Encoding │   Collate   │    Ctype    │   Access privileges   │
╞═══════════╪══════════╪══════════╪═════════════╪═════════════╪═══════════════════════╡
│ postgres  │ postgres │ UTF8     │ en_US.UTF-8 │ en_US.UTF-8 │                       │
│ template0 │ postgres │ UTF8     │ en_US.UTF-8 │ en_US.UTF-8 │ =c/postgres           │
│           │          │          │             │             │ postgres=CTc/postgres │
│ template1 │ postgres │ UTF8     │ en_US.UTF-8 │ en_US.UTF-8 │ =c/postgres           │
│           │          │          │             │             │ postgres=CTc/postgres │
└───────────┴──────────┴──────────┴─────────────┴─────────────┴───────────────────────┘
(3 rows)

postgres=# \pset linestyle double2 \pset border 2 \l
Line style (linestyle) is double2.
Border style (border) is 2.
                                   List of databases
╔═══════════╤══════════╤══════════╤═════════════╤═════════════╤═══════════════════════╗
║   Name    │  Owner   │ Encoding │   Collate   │    Ctype    │   Access privileges   ║
╟───────────┼──────────┼──────────┼─────────────┼─────────────┼───────────────────────╢
║ postgres  │ postgres │ UTF8     │ en_US.UTF-8 │ en_US.UTF-8 │                       ║
║ template0 │ postgres │ UTF8     │ en_US.UTF-8 │ en_US.UTF-8 │ =c/postgres           ║
║           │          │          │             │             │ postgres=CTc/postgres ║
║ template1 │ postgres │ UTF8     │ en_US.UTF-8 │ en_US.UTF-8 │ =c/postgres           ║
║           │          │          │             │             │ postgres=CTc/postgres ║
╚═══════════╧══════════╧══════════╧═════════════╧═════════════╧═══════════════════════╝
(3 rows)

postgres=# \pset linestyle double3 \pset border 2 \l
Line style (linestyle) is double3.
Border style (border) is 2.
                                   List of databases
╔═══════════╦══════════╦══════════╦═════════════╦═════════════╦═══════════════════════╗
║   Name    ║  Owner   ║ Encoding ║   Collate   ║    Ctype    ║   Access privileges   ║
╠═══════════╬══════════╬══════════╬═════════════╬═════════════╬═══════════════════════╣
║ postgres  ║ postgres ║ UTF8     ║ en_US.UTF-8 ║ en_US.UTF-8 ║                       ║
║ template0 ║ postgres ║ UTF8     ║ en_US.UTF-8 ║ en_US.UTF-8 ║ =c/postgres           ║
║           ║          ║          ║             ║             ║ postgres=CTc/postgres ║
║ template1 ║ postgres ║ UTF8     ║ en_US.UTF-8 ║ en_US.UTF-8 ║ =c/postgres           ║
║           ║          ║          ║             ║             ║ postgres=CTc/postgres ║
╚═══════════╩══════════╩══════════╩═════════════╩═════════════╩═══════════════════════╝
(3 rows)

Pavel


Attachment

Re: new unicode table border styles for psql

From
Robert Haas
Date:
On Tue, Nov 26, 2013 at 2:08 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
> Now for the linestyles.  I can see how some of them are attractive, but
> several of them have poor aesthetics, I think.  I don't see a reason to
> accept 7 new styles just for fun.  If I had to choose, I'd consider
> -double1 and -double4 to be acceptable.

I'm confused why we need ANY of these.  What problem are we solving
that the existing unicode style doesn't already solve?  We could
doubtless invent an infinite or at least very large number of
plausible ways to border psql output, but I don't see that as
something that has value.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Re: new unicode table border styles for psql

From
Alvaro Herrera
Date:
Robert Haas escribió:
> On Tue, Nov 26, 2013 at 2:08 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
> > Now for the linestyles.  I can see how some of them are attractive, but
> > several of them have poor aesthetics, I think.  I don't see a reason to
> > accept 7 new styles just for fun.  If I had to choose, I'd consider
> > -double1 and -double4 to be acceptable.
> 
> I'm confused why we need ANY of these.  What problem are we solving
> that the existing unicode style doesn't already solve?  We could
> doubtless invent an infinite or at least very large number of
> plausible ways to border psql output, but I don't see that as
> something that has value.

You know what I think would have some value?  An output style that emits
DocBook markup for tables, something which we could paste on the docs.
(I already use the LaTeX mode to paste in presentation slides.)

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



Re: new unicode table border styles for psql

From
Robert Haas
Date:
On Thu, Nov 28, 2013 at 4:48 PM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> Robert Haas escribió:
>> On Tue, Nov 26, 2013 at 2:08 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
>> > Now for the linestyles.  I can see how some of them are attractive, but
>> > several of them have poor aesthetics, I think.  I don't see a reason to
>> > accept 7 new styles just for fun.  If I had to choose, I'd consider
>> > -double1 and -double4 to be acceptable.
>>
>> I'm confused why we need ANY of these.  What problem are we solving
>> that the existing unicode style doesn't already solve?  We could
>> doubtless invent an infinite or at least very large number of
>> plausible ways to border psql output, but I don't see that as
>> something that has value.
>
> You know what I think would have some value?  An output style that emits
> DocBook markup for tables, something which we could paste on the docs.
> (I already use the LaTeX mode to paste in presentation slides.)

Sure.  I have never personally wanted that, but I see the value of it:
it makes something that's probably annoying to do right now simple.
That's a functional enhancement; this is not.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Re: new unicode table border styles for psql

From
Peter Eisentraut
Date:
On Thu, 2013-11-28 at 16:23 -0500, Robert Haas wrote:
> On Tue, Nov 26, 2013 at 2:08 PM, Peter Eisentraut <peter_e@gmx.net>
> wrote:
> > Now for the linestyles.  I can see how some of them are attractive,
> but
> > several of them have poor aesthetics, I think.  I don't see a reason
> to
> > accept 7 new styles just for fun.  If I had to choose, I'd consider
> > -double1 and -double4 to be acceptable.
> 
> I'm confused why we need ANY of these.

I'm not actually in favor of adding any of these.  I was just trying to
say that any but the ones I mentioned I don't consider acceptable at
all.




Re: new unicode table border styles for psql

From
Peter Eisentraut
Date:
On Thu, 2013-11-28 at 18:48 -0300, Alvaro Herrera wrote:
> An output style that emits
> DocBook markup for tables, something which we could paste on the docs.

DocBook supports HTML tables from version 4.3 on.  We currently use
version 4.2, but we could presumably raise that if needed.




Re: new unicode table border styles for psql

From
Pavel Stehule
Date:



2013/11/28 Robert Haas <robertmhaas@gmail.com>
On Tue, Nov 26, 2013 at 2:08 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
> Now for the linestyles.  I can see how some of them are attractive, but
> several of them have poor aesthetics, I think.  I don't see a reason to
> accept 7 new styles just for fun.  If I had to choose, I'd consider
> -double1 and -double4 to be acceptable.

I'm confused why we need ANY of these.  What problem are we solving
that the existing unicode style doesn't already solve?  We could
doubtless invent an infinite or at least very large number of
plausible ways to border psql output, but I don't see that as
something that has value.

It has primary aesthetic value - not much more (similar value has original unicode border)

With this patch you can prepare a little bit nicer (plain text) reports without using special software. And a implementation is really simply - so it offer sympathetic benefit without any cost.

Regards

Pavel  
 

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: new unicode table border styles for psql

From
Pavel Stehule
Date:



2013/11/28 Alvaro Herrera <alvherre@2ndquadrant.com>
Robert Haas escribió:
> On Tue, Nov 26, 2013 at 2:08 PM, Peter Eisentraut <peter_e@gmx.net> wrote:
> > Now for the linestyles.  I can see how some of them are attractive, but
> > several of them have poor aesthetics, I think.  I don't see a reason to
> > accept 7 new styles just for fun.  If I had to choose, I'd consider
> > -double1 and -double4 to be acceptable.
>
> I'm confused why we need ANY of these.  What problem are we solving
> that the existing unicode style doesn't already solve?  We could
> doubtless invent an infinite or at least very large number of
> plausible ways to border psql output, but I don't see that as
> something that has value.

You know what I think would have some value?  An output style that emits
DocBook markup for tables, something which we could paste on the docs.
(I already use the LaTeX mode to paste in presentation slides.)

Although it sounds crazy - some unicode-doubleX looks well (although it is subjective) and I use it in presentation (and wiki) too - just copy/paste.

Nothing against DocBook support  (or any modern markdown (mediawiki, ..) formats).

Pavel


--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services