Re: [HACKERS] new unicode table border styles for psql
On Tue, Nov 26, 2013 at 2:08 PM, Peter Eisentraut pete...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
Robert Haas escribió: On Tue, Nov 26, 2013 at 2:08 PM, Peter Eisentraut pete...@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 Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
On Thu, Nov 28, 2013 at 4:48 PM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Robert Haas escribió: On Tue, Nov 26, 2013 at 2:08 PM, Peter Eisentraut pete...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
On Thu, 2013-11-28 at 16:23 -0500, Robert Haas wrote: On Tue, Nov 26, 2013 at 2:08 PM, Peter Eisentraut pete...@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. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
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. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
2013/11/28 Robert Haas robertmh...@gmail.com On Tue, Nov 26, 2013 at 2:08 PM, Peter Eisentraut pete...@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: [HACKERS] new unicode table border styles for psql
2013/11/28 Alvaro Herrera alvhe...@2ndquadrant.com Robert Haas escribió: On Tue, Nov 26, 2013 at 2:08 PM, Peter Eisentraut pete...@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 Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training Services
Re: [HACKERS] new unicode table border styles for psql
2013/11/26 Pavel Stehule pavel.steh...@gmail.com 2013/11/26 Peter Eisentraut pete...@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 commit 47b3258db6e3e82399417f57ad551ad740348635 Author: Pavel Stehule pavel.steh...@gooddata.com Date: Wed Nov 27 15:09:01 2013 +0100 initial diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 264cfe6..6e74690 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -2088,9 +2088,10 @@ lo_import 152801 para Sets the border line drawing style to one of literalascii/literal, literalold-ascii/literal - or literalunicode/literal. - Unique abbreviations are allowed. (That would mean one - letter is enough.) + or literalunicode/literal, literaldouble1/literal, + literaldouble2/literal or literaldouble3/literal + (unicode styles). Unique abbreviations are allowed. + (That would mean one letter is enough.) The
Re: [HACKERS] new unicode table border styles for psql
sorry for offtopic 2013/11/25 Dimitri Fontaine dimi...@2ndquadrant.fr Andrew Dunstan and...@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: [HACKERS] new unicode table border styles for psql
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. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
2013/11/26 Peter Eisentraut pete...@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: [HACKERS] new unicode table border styles for psql
Pavel Stehule pavel.steh...@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, Emacs Lisp http://www.lua.org/ MIT Lua Regards, -- Dimitri Fontaine http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
On Mon, Nov 25, 2013 at 3:33 AM, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Pavel Stehule pavel.steh...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
On 11/25/2013 09:00 AM, Merlin Moncure wrote: On Mon, Nov 25, 2013 at 3:33 AM, Dimitri Fontaine dimi...@2ndquadrant.fr wrote: Pavel Stehule pavel.steh...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
Andrew Dunstan and...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
On 11/25/2013 09:33 AM, Dimitri Fontaine wrote: Andrew Dunstan and...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
Andrew Dunstan and...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
Hello 2013/11/21 Peter Eisentraut pete...@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: [HACKERS] new unicode table border styles for psql
Hello 2013/11/21 Merlin Moncure mmonc...@gmail.com On Thu, Nov 21, 2013 at 1:09 AM, Pavel Stehule pavel.steh...@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: [HACKERS] new unicode table border styles for psql
2013/11/21 Szymon Guz mabew...@gmail.com On 21 November 2013 21:15, Szymon Guz mabew...@gmail.com wrote: On 21 November 2013 20:20, Pavel Stehule pavel.steh...@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 mabew...@gmail.com On 21 November 2013 08:09, Pavel Stehule pavel.steh...@gmail.comwrote: 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 commit 43f0026617891485f5ceddce6024b164622ac4cc Author: root root@localhost.localdomain Date: Thu Nov 21 20:16:00 2013 +0100 initial diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 264cfe6..aad2304 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -1947,7 +1947,8 @@ lo_import 152801 acronymHTML/acronym format, this will translate directly into the literalborder=.../literal attribute; in the other formats only values 0 (no border), 1 (internal dividing lines), - and 2 (table frame) make sense. + and 2 (table frame), 3 (internal dividing lines with rows + separators), 4 (table frame with internal divided cells). literallatex/literal and literallatex-longtable/literal also support a literalborder/literal value of 3 which adds a dividing line between each row. @@ -2087,8 +2088,11 @@ lo_import 152801 listitem para Sets the border line drawing style to one - of literalascii/literal, literalold-ascii/literal - or literalunicode/literal. + of literalascii/literal, literalold-ascii/literal, + literalunicode/literal, literalunicode-double1/literal, + literalunicode-double2/literal, literalunicode-double3/literal, + literalunicode-double4/literal, literalunicode-double5/literal, + literalunicode-bold1/literal or literalunicode-bold2/literal. Unique abbreviations are allowed. (That would mean one letter is enough.) The default setting is literalascii/. diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index 638d8cb..7b2b621 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -2271,7 +2271,6 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) psql_error(\\pset: allowed formats are unaligned, aligned, wrapped, html, latex, troff-ms\n); return false; } - } /* set table line style */ @@ -2285,12 +2284,27 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) popt-topt.line_style = pg_asciiformat_old; else if (pg_strncasecmp(unicode, value, vallen) == 0) popt-topt.line_style = pg_utf8format; + else if (pg_strncasecmp(unicode2, value, vallen) == 0) + popt-topt.line_style = pg_utf8format2; + else if (pg_strncasecmp(unicode-double1, value, vallen) == 0) + popt-topt.line_style = pg_utf8double1format; + else if (pg_strncasecmp(unicode-double2, value, vallen) == 0) + popt-topt.line_style = pg_utf8double2format; + else if (pg_strncasecmp(unicode-double3, value, vallen) == 0) + popt-topt.line_style = pg_utf8double3format; + else if (pg_strncasecmp(unicode-double4, value, vallen) == 0) + popt-topt.line_style = pg_utf8double4format; + else if (pg_strncasecmp(unicode-double5, value, vallen) == 0) + popt-topt.line_style = pg_utf8double5format; + else if (pg_strncasecmp(unicode-bold1, value, vallen) == 0) + popt-topt.line_style = pg_utf8bold1format; + else if (pg_strncasecmp(unicode-bold2, value, vallen) == 0) + popt-topt.line_style = pg_utf8bold2format; else { psql_error(\\pset: allowed line styles are ascii, old-ascii, unicode\n); return false; } - } /* set border style/width */ @@ -2298,7 +2312,6 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) { if (value) popt-topt.border =
Re: [HACKERS] new unicode table border styles for psql
On Fri, Nov 22, 2013 at 2:23 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Hello 2013/11/21 Merlin Moncure mmonc...@gmail.com On Thu, Nov 21, 2013 at 1:09 AM, Pavel Stehule pavel.steh...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
2013/11/22 Merlin Moncure mmonc...@gmail.com On Fri, Nov 22, 2013 at 2:23 AM, Pavel Stehule pavel.steh...@gmail.com wrote: Hello 2013/11/21 Merlin Moncure mmonc...@gmail.com On Thu, Nov 21, 2013 at 1:09 AM, Pavel Stehule pavel.steh...@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: [HACKERS] new unicode table border styles for psql
Pavel Stehule escribió: 2013/11/21 Peter Eisentraut pete...@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 Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
On Fri, Nov 22, 2013 at 8:45 AM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Pavel Stehule escribió: 2013/11/21 Peter Eisentraut pete...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
2013/11/22 Alvaro Herrera alvhe...@2ndquadrant.com Pavel Stehule escribió: 2013/11/21 Peter Eisentraut pete...@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 Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training Services
Re: [HACKERS] new unicode table border styles for psql
On 21 November 2013 08:09, Pavel Stehule pavel.steh...@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: [HACKERS] new unicode table border styles for psql
YES! +1 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
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 mabew...@gmail.com napsal(a): On 21 November 2013 21:15, Szymon Guz mabew...@gmail.com wrote: On 21 November 2013 20:20, Pavel Stehule pavel.steh...@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 mabew...@gmail.com On 21 November 2013 08:09, Pavel Stehule pavel.steh...@gmail.comwrote: 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: [HACKERS] new unicode table border styles for psql
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. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
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 mabew...@gmail.com On 21 November 2013 08:09, Pavel Stehule pavel.steh...@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 commit 170c25a680a43a9bd96e2ca923cbd2492d35ceda Author: root root@localhost.localdomain Date: Thu Nov 21 20:16:00 2013 +0100 initial diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index 638d8cb..7b2b621 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -2271,7 +2271,6 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) psql_error(\\pset: allowed formats are unaligned, aligned, wrapped, html, latex, troff-ms\n); return false; } - } /* set table line style */ @@ -2285,12 +2284,27 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) popt-topt.line_style = pg_asciiformat_old; else if (pg_strncasecmp(unicode, value, vallen) == 0) popt-topt.line_style = pg_utf8format; + else if (pg_strncasecmp(unicode2, value, vallen) == 0) + popt-topt.line_style = pg_utf8format2; + else if (pg_strncasecmp(unicode-double1, value, vallen) == 0) + popt-topt.line_style = pg_utf8double1format; + else if (pg_strncasecmp(unicode-double2, value, vallen) == 0) + popt-topt.line_style = pg_utf8double2format; + else if (pg_strncasecmp(unicode-double3, value, vallen) == 0) + popt-topt.line_style = pg_utf8double3format; + else if (pg_strncasecmp(unicode-double4, value, vallen) == 0) + popt-topt.line_style = pg_utf8double4format; + else if (pg_strncasecmp(unicode-double5, value, vallen) == 0) + popt-topt.line_style = pg_utf8double5format; + else if (pg_strncasecmp(unicode-bold1, value, vallen) == 0) + popt-topt.line_style = pg_utf8bold1format; + else if (pg_strncasecmp(unicode-bold2, value, vallen) == 0) + popt-topt.line_style = pg_utf8bold2format; else { psql_error(\\pset: allowed line styles are ascii, old-ascii, unicode\n); return false; } - } /* set border style/width */ @@ -2298,7 +2312,6 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet) { if (value) popt-topt.border = atoi(value); - } /* set expanded/vertical mode */ diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c index 736225c..6f4473a 100644 --- a/src/bin/psql/print.c +++ b/src/bin/psql/print.c @@ -54,6 +54,8 @@ const printTextFormat pg_asciiformat = {-, +, +, +}, {-, +, +, +}, {-, +, +, +}, + {-, +, +, +}, + {, |, |, |}, {, |, |, |} }, |, @@ -75,6 +77,8 @@ const printTextFormat pg_asciiformat_old = {-, +, +, +}, {-, +, +, +}, {-, +, +, +}, + {-, +, +, +}, + {, |, |, |}, {, |, |, |} }, :, @@ -97,9 +101,13 @@ const printTextFormat pg_utf8format = {\342\224\200, \342\224\214, \342\224\254, \342\224\220}, /* ─, ├, ┼, ┤ */ {\342\224\200, \342\224\234, \342\224\274, \342\224\244}, + /* ─, ├, ┼, ┤ */ + {\342\224\200, \342\224\234, \342\224\274, \342\224\244}, /* ─, └, ┴, ┘ */ {\342\224\200, \342\224\224, \342\224\264, \342\224\230}, /* N/A, │, │, │ */ + {, \342\224\202, \342\224\202, \342\224\202}, + /* N/A, │, │, │ */ {, \342\224\202, \342\224\202, \342\224\202} }, /* │ */ @@ -121,6 +129,253 @@ const printTextFormat pg_utf8format = true }; +const printTextFormat pg_utf8format2 = { + unicode2, + { + /* ─, ┌, ┬, ┐ */ + {\342\224\200, \342\224\214, \342\224\254, \342\224\220}, + /* ─, ├, ┴, ┤ */ + {\342\224\200, \342\224\234, \342\224\264, \342\224\244}, + /* ─, ├, ┼, ┤ */ + {\342\224\200, \342\224\234, \342\224\274, \342\224\244}, + /* ─, └, ─, ┘ */ + {\342\224\200, \342\224\224, \342\224\200, \342\224\230}, + /* N/A, │, │, │ */ + {, \342\224\202, \342\224\202, \342\224\202}, + /* N/A, │, │, │ */ + {, \342\224\202, \342\224\202, \342\224\202} + }, + /* │ */ + \342\224\202, + /* │ */ + \342\224\202, + /* │ */ + \342\224\202, + , + , + , + , + , + , + false +}; + +const printTextFormat pg_utf8double1format = { + unicode-double1, + { + /* ═, ╔, ╤, ╗ */ + {\342\225\220, \342\225\224, \342\225\244, \342\225\227}, + /* ─, ╟, ┼, ╢ */ + {\342\224\200, \342\225\237, \342\224\274, \342\225\242}, + /* ─, ╟, ┼, ╢ */ + {\342\224\200, \342\225\237, \342\224\274, \342\225\242}, + /* ═, ╚, ╧, ╝ */ + {\342\225\220, \342\225\232, \342\225\247, \342\225\235}, + /* N/A, ║, │, ║ */ + {, \342\225\221, \342\224\202, \342\225\221}, + /* N/A, ║, │, ║ */ + {, \342\225\221, \342\224\202, \342\225\221} + }, + /* │ */ + \342\224\202, + /* │ */ + \342\224\202, + /* │ */ + \342\224\202, + , + , + , + , + , + , + false +}; + +const printTextFormat
Re: [HACKERS] new unicode table border styles for psql
On 21 November 2013 20:20, Pavel Stehule pavel.steh...@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 mabew...@gmail.com On 21 November 2013 08:09, Pavel Stehule pavel.steh...@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: [HACKERS] new unicode table border styles for psql
On Thu, Nov 21, 2013 at 1:09 AM, Pavel Stehule pavel.steh...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] new unicode table border styles for psql
On 21 November 2013 21:15, Szymon Guz mabew...@gmail.com wrote: On 21 November 2013 20:20, Pavel Stehule pavel.steh...@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 mabew...@gmail.com On 21 November 2013 08:09, Pavel Stehule pavel.steh...@gmail.comwrote: 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
[HACKERS] new unicode table border styles for psql
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