Other formats in pset like markdown, rst, mediawiki

Started by Jan Michálekabout 9 years ago68 messageshackers
Jump to latest
#1Jan Michálek
godzilalalala@gmail.com

Have a nice day
I`m using \pset format html for generating tables for some documentation,
training, reports, blogs... Mainly sample of data for SQL queries, or
explaining structure etc.
But in some software like sphinx, wiki on redmine, or markdown on github
issues I`m not able to insert table in html into text. Using some
converters or sed script is little bit tricky if I need to create reports
from bash scripts, for example by jenkins.
Is there posibility, that support for some others formats will be added in
the future? Or id posible to create some of this formats by manipulating
with pset? Or I need use xml for export and use some xslt templates, or
lxml etc. to create format that I will be able to copy on wiki page or in
github issue.

Thanks Je;

--
Jelen
Starší čeledín datovýho chlíva

#2Michael Paquier
michael@paquier.xyz
In reply to: Jan Michálek (#1)
Re: Other formats in pset like markdown, rst, mediawiki

On Thu, Feb 23, 2017 at 7:29 PM, Jan Michálek <godzilalalala@gmail.com> wrote:

Is there possibility, that support for some others formats will be added in
the future? Or is it possible to create some of this formats by manipulating
with pset?

Addition of new formats is definitely possible, the latest one added
was asciidoc from two years back that I spent some time playing with:
- thread: /messages/by-id/CAFjNrYsppN=GbBuFw0kmk10uZczdqeax0vr3L6wOinmvEDibsg@mail.gmail.com
- commit: http://git.postgresql.org/pg/commitdiff/9d9991c84e64c0c5f568b3cdaf46bb91a1368b5a
If you want to submit patches in this area you can get inspiration
from this example, such changes are rather mechanical.
--
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Jan Michálek (#1)
Re: Other formats in pset like markdown, rst, mediawiki

Jan Mich�lek wrote:

Is there posibility, that support for some others formats will be added in
the future? Or id posible to create some of this formats by manipulating
with pset? Or I need use xml for export and use some xslt templates, or
lxml etc. to create format that I will be able to copy on wiki page or in
github issue.

I would love to have something that generates Markdown tables. One of
the goals of psql is to make common tasks easy, and IMO generating
tables in formats commonly used in documents is one such task.

I think we discussed the idea of Markdown awhile ago, and eventually
found out that you absolutely need to align things following some crazy
rules, or the markdown processor just gives up on them. (It works fine
for simple table contents, but if you have to escape a character
somewhere, then the alignment needs to subtract the escaping character,
or something like that)

The pandoc document http://pandoc.org/MANUAL.html#tables appears to
suggest we could use "pipe tables" to get rid of the alignment
requirement, but then the result is ugly. It's a pity that multiline
rows don't work in that mode, also.

If you come up with code to generate good pandoc Markdown tables, I am
happy to help.

--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, 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

#4Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Alvaro Herrera (#3)
Re: Other formats in pset like markdown, rst, mediawiki

Leknín Řepánek wrote:

I was mainly using tables in rst, i think, that this format is very
similar to "grid tables" in markdown. And it is really similar to default borders used
in psql with border 2.

Great. So are you writing the code now? :-)

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, 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

#5Jan Michálek
godzilalalala@gmail.com
In reply to: Alvaro Herrera (#4)
Re: Other formats in pset like markdown, rst, mediawiki

I can try it, doesn`t look dificult, but I`m worry, that I`m not able to
write clean, pretty code.

2017-02-23 18:03 GMT+01:00 Alvaro Herrera <alvherre@2ndquadrant.com>:

Leknín Řepánek wrote:

I was mainly using tables in rst, i think, that this format is very
similar to "grid tables" in markdown. And it is really similar to

default borders used

in psql with border 2.

Great. So are you writing the code now? :-)

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

--
Jelen
Starší čeledín datovýho chlíva

#6Jan Michálek
godzilalalala@gmail.com
In reply to: Alvaro Herrera (#3)
Re: Other formats in pset like markdown, rst, mediawiki

I was mainly using tables in rst, i think, that this format is very
similar to "grid tables" in markdown. And it is really similar to default borders used
in psql with border 2.

On Thu, Feb 23, 2017 at 12:06:36PM -0300, Alvaro Herrera wrote:

Jan Mich�lek wrote:

Is there posibility, that support for some others formats will be added in
the future? Or id posible to create some of this formats by manipulating
with pset? Or I need use xml for export and use some xslt templates, or
lxml etc. to create format that I will be able to copy on wiki page or in
github issue.

I would love to have something that generates Markdown tables. One of
the goals of psql is to make common tasks easy, and IMO generating
tables in formats commonly used in documents is one such task.

I think we discussed the idea of Markdown awhile ago, and eventually
found out that you absolutely need to align things following some crazy
rules, or the markdown processor just gives up on them. (It works fine
for simple table contents, but if you have to escape a character
somewhere, then the alignment needs to subtract the escaping character,
or something like that)

The pandoc document http://pandoc.org/MANUAL.html#tables appears to
suggest we could use "pipe tables" to get rid of the alignment
requirement, but then the result is ugly. It's a pity that multiline
rows don't work in that mode, also.

If you come up with code to generate good pandoc Markdown tables, I am
happy to help.

--
�lvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, 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

#7Pavel Stehule
pavel.stehule@gmail.com
In reply to: Jan Michálek (#5)
Re: Other formats in pset like markdown, rst, mediawiki

2017-02-23 19:09 GMT+01:00 Jan Michálek <godzilalalala@gmail.com>:

I can try it, doesn`t look dificult, but I`m worry, that I`m not able to
write clean, pretty code.

It is not a problem, there is lot of iteration for code cleaning

Regards

Pavel

Show quoted text

2017-02-23 18:03 GMT+01:00 Alvaro Herrera <alvherre@2ndquadrant.com>:

Leknín Řepánek wrote:

I was mainly using tables in rst, i think, that this format is very
similar to "grid tables" in markdown. And it is really similar to

default borders used

in psql with border 2.

Great. So are you writing the code now? :-)

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

--
Jelen
Starší čeledín datovýho chlíva

#8Michael Paquier
michael@paquier.xyz
In reply to: Jan Michálek (#5)
Re: Other formats in pset like markdown, rst, mediawiki

On Fri, Feb 24, 2017 at 3:09 AM, Jan Michálek <godzilalalala@gmail.com> wrote:

I can try it, doesn`t look dificult, but I`m worry, that I`m not able to
write clean, pretty code.

If you want to have something available in Postgres 10, you had better
be quick. The last commit fest of the development cycle of Postgres 10
begins on the 1st of March, you need to to register your patch here:
https://commitfest.postgresql.org/13/
Here are also some rough guidelines about submitting a patch:
https://wiki.postgresql.org/wiki/Submitting_a_Patch
--
Michael

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#9Jan Michálek
godzilalalala@gmail.com
In reply to: Michael Paquier (#8)
Re: Other formats in pset like markdown, rst, mediawiki

Current state is something like this (diff is attached).
I currently haven`t regression test, tab completion etc., I will add this
thing following structure of asciidoc commit.

Output is tested using retext, rst is OK, md have problem with cells with
newline (i must find out, how it is possible create table with this in
markdown).

[jelen@laptak patch_postgre_rst]$
[jelen@laptak psql]$ ./psql
psql (9.6.2, server 9.6.1)
Type "help" for help.

jelen=# \pset linestyle markdown
Line style is markdown.
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký kobyly'),
('''',E'a\tb') \g | xclip
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký kobyly'),
('''',E'a\tb') \g

| column1 | column2 |
|---------------|------------------|
| nasral Franta | Žluťoučký kobyly |
| na trabanta | |
| ' | a b |

(2 rows)

jelen=# \pset linestyle rst
Line style is rst.
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký kobyly'),
('''',E'a\tb') \g
+---------------+------------------+
| column1 | column2 |
+===============+==================+
| nasral Franta+| Žluťoučký kobyly |
| na trabanta | |
+---------------+------------------+
| ' | a b |
+---------------+------------------+

(2 rows)

jelen=#

2017-02-24 0:46 GMT+01:00 Michael Paquier <michael.paquier@gmail.com>:

On Fri, Feb 24, 2017 at 3:09 AM, Jan Michálek <godzilalalala@gmail.com>
wrote:

I can try it, doesn`t look dificult, but I`m worry, that I`m not able to
write clean, pretty code.

If you want to have something available in Postgres 10, you had better
be quick. The last commit fest of the development cycle of Postgres 10
begins on the 1st of March, you need to to register your patch here:
https://commitfest.postgresql.org/13/
Here are also some rough guidelines about submitting a patch:
https://wiki.postgresql.org/wiki/Submitting_a_Patch
--
Michael

--
Jelen
Starší čeledín datovýho chlíva

Attachments:

patch_markdown_rst.txttext/plain; charset=US-ASCII; name=patch_markdown_rst.txtDownload+70-2
#10Jan Michálek
godzilalalala@gmail.com
In reply to: Jan Michálek (#9)
Re: Other formats in pset like markdown, rst, mediawiki

There it is, what i have.
I need i small help with psql.out, because \pset format wrapped. I don`t
know, how to have it in fixed width.

2017-02-28 14:23 GMT+01:00 Jan Michálek <godzilalalala@gmail.com>:

Current state is something like this (diff is attached).
I currently haven`t regression test, tab completion etc., I will add this
thing following structure of asciidoc commit.

Output is tested using retext, rst is OK, md have problem with cells with
newline (i must find out, how it is possible create table with this in
markdown).

[jelen@laptak patch_postgre_rst]$
[jelen@laptak psql]$ ./psql
psql (9.6.2, server 9.6.1)
Type "help" for help.

jelen=# \pset linestyle markdown
Line style is markdown.
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký kobyly'),
('''',E'a\tb') \g | xclip
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký kobyly'),
('''',E'a\tb') \g

| column1 | column2 |
|---------------|------------------|
| nasral Franta | Žluťoučký kobyly |
| na trabanta | |
| ' | a b |

(2 rows)

jelen=# \pset linestyle rst
Line style is rst.
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký kobyly'),
('''',E'a\tb') \g
+---------------+------------------+
| column1 | column2 |
+===============+==================+
| nasral Franta+| Žluťoučký kobyly |
| na trabanta | |
+---------------+------------------+
| ' | a b |
+---------------+------------------+

(2 rows)

jelen=#

2017-02-24 0:46 GMT+01:00 Michael Paquier <michael.paquier@gmail.com>:

On Fri, Feb 24, 2017 at 3:09 AM, Jan Michálek <godzilalalala@gmail.com>
wrote:

I can try it, doesn`t look dificult, but I`m worry, that I`m not able to
write clean, pretty code.

If you want to have something available in Postgres 10, you had better
be quick. The last commit fest of the development cycle of Postgres 10
begins on the 1st of March, you need to to register your patch here:
https://commitfest.postgresql.org/13/
Here are also some rough guidelines about submitting a patch:
https://wiki.postgresql.org/wiki/Submitting_a_Patch
--
Michael

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

Attachments:

patch_markdown_rst.difftext/plain; charset=US-ASCII; name=patch_markdown_rst.diffDownload+179-4
#11Jan Michálek
godzilalalala@gmail.com
In reply to: Jan Michálek (#10)
Re: Other formats in pset like markdown, rst, mediawiki

Sorry, I have some errors in my diff, i had copy something from bad folder.
I will fix it.

2017-03-01 0:27 GMT+01:00 Jan Michálek <godzilalalala@gmail.com>:

There it is, what i have.
I need i small help with psql.out, because \pset format wrapped. I don`t
know, how to have it in fixed width.

2017-02-28 14:23 GMT+01:00 Jan Michálek <godzilalalala@gmail.com>:

Current state is something like this (diff is attached).
I currently haven`t regression test, tab completion etc., I will add this
thing following structure of asciidoc commit.

Output is tested using retext, rst is OK, md have problem with cells with
newline (i must find out, how it is possible create table with this in
markdown).

[jelen@laptak patch_postgre_rst]$
[jelen@laptak psql]$ ./psql
psql (9.6.2, server 9.6.1)
Type "help" for help.

jelen=# \pset linestyle markdown
Line style is markdown.
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký kobyly'),
('''',E'a\tb') \g | xclip
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký kobyly'),
('''',E'a\tb') \g

| column1 | column2 |
|---------------|------------------|
| nasral Franta | Žluťoučký kobyly |
| na trabanta | |
| ' | a b |

(2 rows)

jelen=# \pset linestyle rst
Line style is rst.
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký kobyly'),
('''',E'a\tb') \g
+---------------+------------------+
| column1 | column2 |
+===============+==================+
| nasral Franta+| Žluťoučký kobyly |
| na trabanta | |
+---------------+------------------+
| ' | a b |
+---------------+------------------+

(2 rows)

jelen=#

2017-02-24 0:46 GMT+01:00 Michael Paquier <michael.paquier@gmail.com>:

On Fri, Feb 24, 2017 at 3:09 AM, Jan Michálek <godzilalalala@gmail.com>
wrote:

I can try it, doesn`t look dificult, but I`m worry, that I`m not able

to

write clean, pretty code.

If you want to have something available in Postgres 10, you had better
be quick. The last commit fest of the development cycle of Postgres 10
begins on the 1st of March, you need to to register your patch here:
https://commitfest.postgresql.org/13/
Here are also some rough guidelines about submitting a patch:
https://wiki.postgresql.org/wiki/Submitting_a_Patch
--
Michael

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

#12Jan Michálek
godzilalalala@gmail.com
In reply to: Jan Michálek (#11)
Re: Other formats in pset like markdown, rst, mediawiki

Regression test corrected.

2017-03-01 11:43 GMT+01:00 Jan Michálek <godzilalalala@gmail.com>:

Sorry, I have some errors in my diff, i had copy something from bad
folder. I will fix it.

2017-03-01 0:27 GMT+01:00 Jan Michálek <godzilalalala@gmail.com>:

There it is, what i have.
I need i small help with psql.out, because \pset format wrapped. I don`t
know, how to have it in fixed width.

2017-02-28 14:23 GMT+01:00 Jan Michálek <godzilalalala@gmail.com>:

Current state is something like this (diff is attached).
I currently haven`t regression test, tab completion etc., I will add
this thing following structure of asciidoc commit.

Output is tested using retext, rst is OK, md have problem with cells
with newline (i must find out, how it is possible create table with this in
markdown).

[jelen@laptak patch_postgre_rst]$
[jelen@laptak psql]$ ./psql
psql (9.6.2, server 9.6.1)
Type "help" for help.

jelen=# \pset linestyle markdown
Line style is markdown.
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký kobyly'),
('''',E'a\tb') \g | xclip
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký kobyly'),
('''',E'a\tb') \g

| column1 | column2 |
|---------------|------------------|
| nasral Franta | Žluťoučký kobyly |
| na trabanta | |
| ' | a b |

(2 rows)

jelen=# \pset linestyle rst
Line style is rst.
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký kobyly'),
('''',E'a\tb') \g
+---------------+------------------+
| column1 | column2 |
+===============+==================+
| nasral Franta+| Žluťoučký kobyly |
| na trabanta | |
+---------------+------------------+
| ' | a b |
+---------------+------------------+

(2 rows)

jelen=#

2017-02-24 0:46 GMT+01:00 Michael Paquier <michael.paquier@gmail.com>:

On Fri, Feb 24, 2017 at 3:09 AM, Jan Michálek <godzilalalala@gmail.com>
wrote:

I can try it, doesn`t look dificult, but I`m worry, that I`m not able

to

write clean, pretty code.

If you want to have something available in Postgres 10, you had better
be quick. The last commit fest of the development cycle of Postgres 10
begins on the 1st of March, you need to to register your patch here:
https://commitfest.postgresql.org/13/
Here are also some rough guidelines about submitting a patch:
https://wiki.postgresql.org/wiki/Submitting_a_Patch
--
Michael

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

Attachments:

patch_markdown_rst.difftext/plain; charset=US-ASCII; name=patch_markdown_rst.diffDownload+184-4
#13Peter Eisentraut
peter_e@gmx.net
In reply to: Jan Michálek (#12)
Re: Other formats in pset like markdown, rst, mediawiki

If you want to implement a new table format, you should be looking at
\pset format, not \pset linestyle. \pset format sets different table
formats, such as html, latex, and asciidoc. \pset linestyle just
chooses between different styles for the plain-text table format.

On 3/1/17 06:31, Jan Michálek wrote:

Regression test corrected.

2017-03-01 11:43 GMT+01:00 Jan Michálek <godzilalalala@gmail.com
<mailto:godzilalalala@gmail.com>>:

Sorry, I have some errors in my diff, i had copy something from bad
folder. I will fix it.

2017-03-01 0:27 GMT+01:00 Jan Michálek <godzilalalala@gmail.com
<mailto:godzilalalala@gmail.com>>:

There it is, what i have.
I need i small help with psql.out, because \pset format wrapped.
I don`t know, how to have it in fixed width.

2017-02-28 14:23 GMT+01:00 Jan Michálek <godzilalalala@gmail.com
<mailto:godzilalalala@gmail.com>>:

Current state is something like this (diff is attached).
I currently haven`t regression test, tab completion etc., I
will add this thing following structure of asciidoc commit.

Output is tested using retext, rst is OK, md have problem
with cells with newline (i must find out, how it is possible
create table with this in markdown).

[jelen@laptak patch_postgre_rst]$
[jelen@laptak psql]$ ./psql
psql (9.6.2, server 9.6.1)
Type "help" for help.

jelen=# \pset linestyle markdown
Line style is markdown.
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký
kobyly'), ('''',E'a\tb') \g | xclip
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký
kobyly'), ('''',E'a\tb') \g

| column1 | column2 |
|---------------|------------------|
| nasral Franta | Žluťoučký kobyly |
| na trabanta | |
| ' | a b |

(2 rows)

jelen=# \pset linestyle rst
Line style is rst.
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký
kobyly'), ('''',E'a\tb') \g
+---------------+------------------+
| column1 | column2 |
+===============+==================+
| nasral Franta+| Žluťoučký kobyly |
| na trabanta | |
+---------------+------------------+
| ' | a b |
+---------------+------------------+

(2 rows)

jelen=#

2017-02-24 0:46 GMT+01:00 Michael Paquier
<michael.paquier@gmail.com <mailto:michael.paquier@gmail.com>>:

On Fri, Feb 24, 2017 at 3:09 AM, Jan Michálek
<godzilalalala@gmail.com
<mailto:godzilalalala@gmail.com>> wrote:

I can try it, doesn`t look dificult, but I`m worry, that I`m not able to
write clean, pretty code.

If you want to have something available in Postgres 10,
you had better
be quick. The last commit fest of the development cycle
of Postgres 10
begins on the 1st of March, you need to to register your
patch here:
https://commitfest.postgresql.org/13/
<https://commitfest.postgresql.org/13/&gt;
Here are also some rough guidelines about submitting a
patch:
https://wiki.postgresql.org/wiki/Submitting_a_Patch
<https://wiki.postgresql.org/wiki/Submitting_a_Patch&gt;
--
Michael

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, 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

#14Jan Michálek
godzilalalala@gmail.com
In reply to: Peter Eisentraut (#13)
Re: Other formats in pset like markdown, rst, mediawiki

I know, but, both new linestyles are created literally by cloning ascii
linestyle and few lines in print_aligned_text. Both works with "aligned"
and "wrapped" format. In rst is wrapped format useful, in my opinion, in
markdown i can`t find how I can get newline in record (maybe it is not
posiible in main markdown types). So it is why i add markdown and rst as
new linestyles. But it is not problem to change it in command to use "\pset
format", but i mean, that this is cleaner.

Je;

jelen=# \pset linestyle rst
Line style is rst.
jelen=# \pset format wrapped
Output format is wrapped.
jelen=# SELECT repeat('Goodnight Irene ', 30);
+-----------------------------------------------------------------------------+
|
repeat                                    |
+=============================================================================+
| Goodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight
I.|
|.rene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene
Goodni.|
|.ght Irene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene
G.|
|.oodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight
Ir.|
|.ene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene
Goodnig.|
|.ht Irene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene
Go.|
|.odnight Irene Goodnight
Irene                                               |
+-----------------------------------------------------------------------------+

(1 row)

jelen=#

2017-03-01 15:00 GMT+01:00 Peter Eisentraut <peter.eisentraut@2ndquadrant.
com>:

If you want to implement a new table format, you should be looking at
\pset format, not \pset linestyle. \pset format sets different table
formats, such as html, latex, and asciidoc. \pset linestyle just
chooses between different styles for the plain-text table format.

On 3/1/17 06:31, Jan Michálek wrote:

Regression test corrected.

2017-03-01 11:43 GMT+01:00 Jan Michálek <godzilalalala@gmail.com
<mailto:godzilalalala@gmail.com>>:

Sorry, I have some errors in my diff, i had copy something from bad
folder. I will fix it.

2017-03-01 0:27 GMT+01:00 Jan Michálek <godzilalalala@gmail.com
<mailto:godzilalalala@gmail.com>>:

There it is, what i have.
I need i small help with psql.out, because \pset format wrapped.
I don`t know, how to have it in fixed width.

2017-02-28 14:23 GMT+01:00 Jan Michálek <godzilalalala@gmail.com
<mailto:godzilalalala@gmail.com>>:

Current state is something like this (diff is attached).
I currently haven`t regression test, tab completion etc., I
will add this thing following structure of asciidoc commit.

Output is tested using retext, rst is OK, md have problem
with cells with newline (i must find out, how it is possible
create table with this in markdown).

[jelen@laptak patch_postgre_rst]$
[jelen@laptak psql]$ ./psql
psql (9.6.2, server 9.6.1)
Type "help" for help.

jelen=# \pset linestyle markdown
Line style is markdown.
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký
kobyly'), ('''',E'a\tb') \g | xclip
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký
kobyly'), ('''',E'a\tb') \g

| column1 | column2 |
|---------------|------------------|
| nasral Franta | Žluťoučký kobyly |
| na trabanta | |
| ' | a b |

(2 rows)

jelen=# \pset linestyle rst
Line style is rst.
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký
kobyly'), ('''',E'a\tb') \g
+---------------+------------------+
| column1 | column2 |
+===============+==================+
| nasral Franta+| Žluťoučký kobyly |
| na trabanta | |
+---------------+------------------+
| ' | a b |
+---------------+------------------+

(2 rows)

jelen=#

2017-02-24 0:46 GMT+01:00 Michael Paquier
<michael.paquier@gmail.com <mailto:michael.paquier@gmail.com

:

On Fri, Feb 24, 2017 at 3:09 AM, Jan Michálek
<godzilalalala@gmail.com
<mailto:godzilalalala@gmail.com>> wrote:

I can try it, doesn`t look dificult, but I`m worry,

that I`m not able to

write clean, pretty code.

If you want to have something available in Postgres 10,
you had better
be quick. The last commit fest of the development cycle
of Postgres 10
begins on the 1st of March, you need to to register your
patch here:
https://commitfest.postgresql.org/13/
<https://commitfest.postgresql.org/13/&gt;
Here are also some rough guidelines about submitting a
patch:
https://wiki.postgresql.org/wiki/Submitting_a_Patch
<https://wiki.postgresql.org/wiki/Submitting_a_Patch&gt;
--
Michael

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Jelen
Starší čeledín datovýho chlíva

#15Pavel Stehule
pavel.stehule@gmail.com
In reply to: Jan Michálek (#14)
Re: Other formats in pset like markdown, rst, mediawiki

2017-03-05 11:40 GMT+01:00 Jan Michálek <godzilalalala@gmail.com>:

I know, but, both new linestyles are created literally by cloning ascii
linestyle and few lines in print_aligned_text. Both works with "aligned"
and "wrapped" format. In rst is wrapped format useful, in my opinion, in
markdown i can`t find how I can get newline in record (maybe it is not
posiible in main markdown types). So it is why i add markdown and rst as
new linestyles. But it is not problem to change it in command to use "\pset
format", but i mean, that this is cleaner.

Using a special linestyle for new format is possible probably. But new
format should be switched with \pset format command.

Not sure if wrapped or aligned behave is correct for markdown - it is task
for markdown processing, not for psql.

Regards

Pavel

Show quoted text

Je;

jelen=# \pset linestyle rst
Line style is rst.
jelen=# \pset format wrapped
Output format is wrapped.
jelen=# SELECT repeat('Goodnight Irene ', 30);
+-----------------------------------------------------------
------------------+
|                                   repeat
|
+===========================================================
==================+
| Goodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene
Goodnight I.|
|.rene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene
Goodni.|
|.ght Irene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight
Irene G.|
|.oodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight
Ir.|
|.ene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene
Goodnig.|
|.ht Irene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene
Go.|
|.odnight Irene Goodnight Irene
|
+-----------------------------------------------------------
------------------+

(1 row)

jelen=#

2017-03-01 15:00 GMT+01:00 Peter Eisentraut <peter.eisentraut@2ndquadrant.
com>:

If you want to implement a new table format, you should be looking at
\pset format, not \pset linestyle. \pset format sets different table
formats, such as html, latex, and asciidoc. \pset linestyle just
chooses between different styles for the plain-text table format.

On 3/1/17 06:31, Jan Michálek wrote:

Regression test corrected.

2017-03-01 11:43 GMT+01:00 Jan Michálek <godzilalalala@gmail.com
<mailto:godzilalalala@gmail.com>>:

Sorry, I have some errors in my diff, i had copy something from bad
folder. I will fix it.

2017-03-01 0:27 GMT+01:00 Jan Michálek <godzilalalala@gmail.com
<mailto:godzilalalala@gmail.com>>:

There it is, what i have.
I need i small help with psql.out, because \pset format wrapped.
I don`t know, how to have it in fixed width.

2017-02-28 14:23 GMT+01:00 Jan Michálek <

godzilalalala@gmail.com

<mailto:godzilalalala@gmail.com>>:

Current state is something like this (diff is attached).
I currently haven`t regression test, tab completion etc., I
will add this thing following structure of asciidoc commit.

Output is tested using retext, rst is OK, md have problem
with cells with newline (i must find out, how it is possible
create table with this in markdown).

[jelen@laptak patch_postgre_rst]$
[jelen@laptak psql]$ ./psql
psql (9.6.2, server 9.6.1)
Type "help" for help.

jelen=# \pset linestyle markdown
Line style is markdown.
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký
kobyly'), ('''',E'a\tb') \g | xclip
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký
kobyly'), ('''',E'a\tb') \g

| column1 | column2 |
|---------------|------------------|
| nasral Franta | Žluťoučký kobyly |
| na trabanta | |
| ' | a b |

(2 rows)

jelen=# \pset linestyle rst
Line style is rst.
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký
kobyly'), ('''',E'a\tb') \g
+---------------+------------------+
| column1 | column2 |
+===============+==================+
| nasral Franta+| Žluťoučký kobyly |
| na trabanta | |
+---------------+------------------+
| ' | a b |
+---------------+------------------+

(2 rows)

jelen=#

2017-02-24 0:46 GMT+01:00 Michael Paquier
<michael.paquier@gmail.com <mailto:michael.paquier@gmail.

com>>:

On Fri, Feb 24, 2017 at 3:09 AM, Jan Michálek
<godzilalalala@gmail.com
<mailto:godzilalalala@gmail.com>> wrote:

I can try it, doesn`t look dificult, but I`m worry,

that I`m not able to

write clean, pretty code.

If you want to have something available in Postgres 10,
you had better
be quick. The last commit fest of the development cycle
of Postgres 10
begins on the 1st of March, you need to to register your
patch here:
https://commitfest.postgresql.org/13/
<https://commitfest.postgresql.org/13/&gt;
Here are also some rough guidelines about submitting a
patch:
https://wiki.postgresql.org/wiki/Submitting_a_Patch
<https://wiki.postgresql.org/wiki/Submitting_a_Patch&gt;
--
Michael

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Jelen
Starší čeledín datovýho chlíva

#16Jan Michálek
godzilalalala@gmail.com
In reply to: Pavel Stehule (#15)
Re: Other formats in pset like markdown, rst, mediawiki

It is question if it is really new format, because formating is the same as
aligned/wrapped format, changed is only style of lines.

2017-03-05 12:36 GMT+01:00 Pavel Stehule <pavel.stehule@gmail.com>:

2017-03-05 11:40 GMT+01:00 Jan Michálek <godzilalalala@gmail.com>:

I know, but, both new linestyles are created literally by cloning ascii
linestyle and few lines in print_aligned_text. Both works with "aligned"
and "wrapped" format. In rst is wrapped format useful, in my opinion, in
markdown i can`t find how I can get newline in record (maybe it is not
posiible in main markdown types). So it is why i add markdown and rst as
new linestyles. But it is not problem to change it in command to use "\pset
format", but i mean, that this is cleaner.

Using a special linestyle for new format is possible probably. But new
format should be switched with \pset format command.

Not sure if wrapped or aligned behave is correct for markdown - it is task
for markdown processing, not for psql.

Regards

Pavel

Je;

jelen=# \pset linestyle rst
Line style is rst.
jelen=# \pset format wrapped
Output format is wrapped.
jelen=# SELECT repeat('Goodnight Irene ', 30);
+-----------------------------------------------------------
------------------+
|                                   repeat
|
+===========================================================
==================+
| Goodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene
Goodnight I.|
|.rene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene
Goodni.|
|.ght Irene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight
Irene G.|
|.oodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene
Goodnight Ir.|
|.ene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene
Goodnig.|
|.ht Irene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight
Irene Go.|
|.odnight Irene Goodnight Irene
|
+-----------------------------------------------------------
------------------+

(1 row)

jelen=#

2017-03-01 15:00 GMT+01:00 Peter Eisentraut <
peter.eisentraut@2ndquadrant.com>:

If you want to implement a new table format, you should be looking at
\pset format, not \pset linestyle. \pset format sets different table
formats, such as html, latex, and asciidoc. \pset linestyle just
chooses between different styles for the plain-text table format.

On 3/1/17 06:31, Jan Michálek wrote:

Regression test corrected.

2017-03-01 11:43 GMT+01:00 Jan Michálek <godzilalalala@gmail.com
<mailto:godzilalalala@gmail.com>>:

Sorry, I have some errors in my diff, i had copy something from bad
folder. I will fix it.

2017-03-01 0:27 GMT+01:00 Jan Michálek <godzilalalala@gmail.com
<mailto:godzilalalala@gmail.com>>:

There it is, what i have.
I need i small help with psql.out, because \pset format

wrapped.

I don`t know, how to have it in fixed width.

2017-02-28 14:23 GMT+01:00 Jan Michálek <

godzilalalala@gmail.com

<mailto:godzilalalala@gmail.com>>:

Current state is something like this (diff is attached).
I currently haven`t regression test, tab completion etc., I
will add this thing following structure of asciidoc commit.

Output is tested using retext, rst is OK, md have problem
with cells with newline (i must find out, how it is

possible

create table with this in markdown).

[jelen@laptak patch_postgre_rst]$
[jelen@laptak psql]$ ./psql
psql (9.6.2, server 9.6.1)
Type "help" for help.

jelen=# \pset linestyle markdown
Line style is markdown.
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký
kobyly'), ('''',E'a\tb') \g | xclip
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký
kobyly'), ('''',E'a\tb') \g

| column1 | column2 |
|---------------|------------------|
| nasral Franta | Žluťoučký kobyly |
| na trabanta | |
| ' | a b |

(2 rows)

jelen=# \pset linestyle rst
Line style is rst.
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký
kobyly'), ('''',E'a\tb') \g
+---------------+------------------+
| column1 | column2 |
+===============+==================+
| nasral Franta+| Žluťoučký kobyly |
| na trabanta | |
+---------------+------------------+
| ' | a b |
+---------------+------------------+

(2 rows)

jelen=#

2017-02-24 0:46 GMT+01:00 Michael Paquier
<michael.paquier@gmail.com <mailto:michael.paquier@gmail.

com>>:

On Fri, Feb 24, 2017 at 3:09 AM, Jan Michálek
<godzilalalala@gmail.com
<mailto:godzilalalala@gmail.com>> wrote:

I can try it, doesn`t look dificult, but I`m worry,

that I`m not able to

write clean, pretty code.

If you want to have something available in Postgres 10,
you had better
be quick. The last commit fest of the development cycle
of Postgres 10
begins on the 1st of March, you need to to register

your

patch here:
https://commitfest.postgresql.org/13/
<https://commitfest.postgresql.org/13/&gt;
Here are also some rough guidelines about submitting a
patch:
https://wiki.postgresql.org/wiki/Submitting_a_Patch
<https://wiki.postgresql.org/wiki/Submitting_a_Patch&gt;
--
Michael

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

#17Pavel Stehule
pavel.stehule@gmail.com
In reply to: Jan Michálek (#16)
Re: Other formats in pset like markdown, rst, mediawiki

2017-03-05 13:08 GMT+01:00 Jan Michálek <godzilalalala@gmail.com>:

It is question if it is really new format, because formating is the same
as aligned/wrapped format, changed is only style of lines.

Please, don't do top posting
https://en.wikipedia.org/wiki/Posting_style#Top-posting

2017-03-05 12:36 GMT+01:00 Pavel Stehule <pavel.stehule@gmail.com>:

2017-03-05 11:40 GMT+01:00 Jan Michálek <godzilalalala@gmail.com>:

I know, but, both new linestyles are created literally by cloning ascii
linestyle and few lines in print_aligned_text. Both works with "aligned"
and "wrapped" format. In rst is wrapped format useful, in my opinion, in
markdown i can`t find how I can get newline in record (maybe it is not
posiible in main markdown types). So it is why i add markdown and rst as
new linestyles. But it is not problem to change it in command to use "\pset
format", but i mean, that this is cleaner.

Using a special linestyle for new format is possible probably. But new
format should be switched with \pset format command.

Not sure if wrapped or aligned behave is correct for markdown - it is
task for markdown processing, not for psql.

In this case I am inclined to prefer setting via format setting - you can
set a linestyle and border in one step, and then is easy to return back to
previous format. I don't see a big benefit in enhancing set of ascii
linestyles. The collecting new features in formatting is more intuitive
(for me).

Regards

Pavel

Show quoted text

Regards

Pavel

Je;

jelen=# \pset linestyle rst
Line style is rst.
jelen=# \pset format wrapped
Output format is wrapped.
jelen=# SELECT repeat('Goodnight Irene ', 30);
+-----------------------------------------------------------
------------------+
|                                   repeat
|
+===========================================================
==================+
| Goodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene
Goodnight I.|
|.rene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene
Goodni.|
|.ght Irene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight
Irene G.|
|.oodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene
Goodnight Ir.|
|.ene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight Irene
Goodnig.|
|.ht Irene Goodnight Irene Goodnight Irene Goodnight Irene Goodnight
Irene Go.|
|.odnight Irene Goodnight Irene
|
+-----------------------------------------------------------
------------------+

(1 row)

jelen=#

2017-03-01 15:00 GMT+01:00 Peter Eisentraut <
peter.eisentraut@2ndquadrant.com>:

If you want to implement a new table format, you should be looking at
\pset format, not \pset linestyle. \pset format sets different table
formats, such as html, latex, and asciidoc. \pset linestyle just
chooses between different styles for the plain-text table format.

On 3/1/17 06:31, Jan Michálek wrote:

Regression test corrected.

2017-03-01 11:43 GMT+01:00 Jan Michálek <godzilalalala@gmail.com
<mailto:godzilalalala@gmail.com>>:

Sorry, I have some errors in my diff, i had copy something from

bad

folder. I will fix it.

2017-03-01 0:27 GMT+01:00 Jan Michálek <godzilalalala@gmail.com
<mailto:godzilalalala@gmail.com>>:

There it is, what i have.
I need i small help with psql.out, because \pset format

wrapped.

I don`t know, how to have it in fixed width.

2017-02-28 14:23 GMT+01:00 Jan Michálek <

godzilalalala@gmail.com

<mailto:godzilalalala@gmail.com>>:

Current state is something like this (diff is attached).
I currently haven`t regression test, tab completion etc.,

I

will add this thing following structure of asciidoc

commit.

Output is tested using retext, rst is OK, md have problem
with cells with newline (i must find out, how it is

possible

create table with this in markdown).

[jelen@laptak patch_postgre_rst]$
[jelen@laptak psql]$ ./psql
psql (9.6.2, server 9.6.1)
Type "help" for help.

jelen=# \pset linestyle markdown
Line style is markdown.
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký
kobyly'), ('''',E'a\tb') \g | xclip
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký
kobyly'), ('''',E'a\tb') \g

| column1 | column2 |
|---------------|------------------|
| nasral Franta | Žluťoučký kobyly |
| na trabanta | |
| ' | a b |

(2 rows)

jelen=# \pset linestyle rst
Line style is rst.
jelen=# values(E'nasral Franta\nna trabanta','Žluťoučký
kobyly'), ('''',E'a\tb') \g
+---------------+------------------+
| column1 | column2 |
+===============+==================+
| nasral Franta+| Žluťoučký kobyly |
| na trabanta | |
+---------------+------------------+
| ' | a b |
+---------------+------------------+

(2 rows)

jelen=#

2017-02-24 0:46 GMT+01:00 Michael Paquier
<michael.paquier@gmail.com <mailto:michael.paquier@gmail.

com>>:

On Fri, Feb 24, 2017 at 3:09 AM, Jan Michálek
<godzilalalala@gmail.com
<mailto:godzilalalala@gmail.com>> wrote:

I can try it, doesn`t look dificult, but I`m worry,

that I`m not able to

write clean, pretty code.

If you want to have something available in Postgres

10,

you had better
be quick. The last commit fest of the development

cycle

of Postgres 10
begins on the 1st of March, you need to to register

your

patch here:
https://commitfest.postgresql.org/13/
<https://commitfest.postgresql.org/13/&gt;
Here are also some rough guidelines about submitting a
patch:
https://wiki.postgresql.org/wiki/Submitting_a_Patch
<https://wiki.postgresql.org/wiki/Submitting_a_Patch&gt;
--
Michael

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

#18Pavel Stehule
pavel.stehule@gmail.com
In reply to: Pavel Stehule (#17)
Re: Other formats in pset like markdown, rst, mediawiki

2017-03-05 13:22 GMT+01:00 Pavel Stehule <pavel.stehule@gmail.com>:

2017-03-05 13:08 GMT+01:00 Jan Michálek <godzilalalala@gmail.com>:

It is question if it is really new format, because formating is the same
as aligned/wrapped format, changed is only style of lines.

Please, don't do top posting https://en.wikipedia.org/wiki/
Posting_style#Top-posting

2017-03-05 12:36 GMT+01:00 Pavel Stehule <pavel.stehule@gmail.com>:

2017-03-05 11:40 GMT+01:00 Jan Michálek <godzilalalala@gmail.com>:

I know, but, both new linestyles are created literally by cloning ascii
linestyle and few lines in print_aligned_text. Both works with "aligned"
and "wrapped" format. In rst is wrapped format useful, in my opinion, in
markdown i can`t find how I can get newline in record (maybe it is not
posiible in main markdown types). So it is why i add markdown and rst as
new linestyles. But it is not problem to change it in command to use "\pset
format", but i mean, that this is cleaner.

Using a special linestyle for new format is possible probably. But new
format should be switched with \pset format command.

Not sure if wrapped or aligned behave is correct for markdown - it is
task for markdown processing, not for psql.

In this case I am inclined to prefer setting via format setting - you can
set a linestyle and border in one step, and then is easy to return back to
previous format. I don't see a big benefit in enhancing set of ascii
linestyles. The collecting new features in formatting is more intuitive
(for me).

This can be discussed what we prefer, and what we would to implement?

1. Nice formatted markdown tables

| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |

or 2. enough formatting

Markdown | Less | Pretty
--- | --- | ---
*Still* | `renders` | **nicely**
1 | 2 | 3

Pavel

#19Jan Michálek
godzilalalala@gmail.com
In reply to: Pavel Stehule (#18)
Re: Other formats in pset like markdown, rst, mediawiki

2017-03-05 13:39 GMT+01:00 Pavel Stehule <pavel.stehule@gmail.com>:

2017-03-05 13:22 GMT+01:00 Pavel Stehule <pavel.stehule@gmail.com>:

2017-03-05 13:08 GMT+01:00 Jan Michálek <godzilalalala@gmail.com>:

It is question if it is really new format, because formating is the same
as aligned/wrapped format, changed is only style of lines.

Please, don't do top posting https://en.wikipedia.org/wiki/
Posting_style#Top-posting

2017-03-05 12:36 GMT+01:00 Pavel Stehule <pavel.stehule@gmail.com>:

2017-03-05 11:40 GMT+01:00 Jan Michálek <godzilalalala@gmail.com>:

I know, but, both new linestyles are created literally by cloning
ascii linestyle and few lines in print_aligned_text. Both works with
"aligned" and "wrapped" format. In rst is wrapped format useful, in my
opinion, in markdown i can`t find how I can get newline in record (maybe it
is not posiible in main markdown types). So it is why i add markdown and
rst as new linestyles. But it is not problem to change it in command to use
"\pset format", but i mean, that this is cleaner.

Using a special linestyle for new format is possible probably. But new
format should be switched with \pset format command.

Not sure if wrapped or aligned behave is correct for markdown - it is
task for markdown processing, not for psql.

In this case I am inclined to prefer setting via format setting - you can
set a linestyle and border in one step, and then is easy to return back to
previous format. I don't see a big benefit in enhancing set of ascii
linestyles. The collecting new features in formatting is more intuitive
(for me).

This can be discussed what we prefer, and what we would to implement?

1. Nice formatted markdown tables

| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |

or 2. enough formatting

Markdown | Less | Pretty
--- | --- | ---
*Still* | `renders` | **nicely**
1 | 2 | 3

I personally prefer nice formated table, because more comfortable reading

source of document and easier editing with blocks (deleting whole columns
etc.).
I will change \pset to format.
I find, when adding <\br> for newline works in retext. I will try to add it
to patch.

| Tables | Are | Cool |

| ------------- |:-------------:| -----:|

| col 3 is | right-aligned | $1600 |

| col 2 is | centere<br/>d | $12 |

| zebra stripes | are neat | $1 |

Jan

Pavel

--
Jelen
Starší čeledín datovýho chlíva

#20Jan Michálek
godzilalalala@gmail.com
In reply to: Jan Michálek (#19)
Re: Other formats in pset like markdown, rst, mediawiki

2017-03-05 14:02 GMT+01:00 Jan Michálek <godzilalalala@gmail.com>:

2017-03-05 13:39 GMT+01:00 Pavel Stehule <pavel.stehule@gmail.com>:

2017-03-05 13:22 GMT+01:00 Pavel Stehule <pavel.stehule@gmail.com>:

2017-03-05 13:08 GMT+01:00 Jan Michálek <godzilalalala@gmail.com>:

It is question if it is really new format, because formating is the
same as aligned/wrapped format, changed is only style of lines.

Please, don't do top posting https://en.wikipedia.org/wiki/
Posting_style#Top-posting

2017-03-05 12:36 GMT+01:00 Pavel Stehule <pavel.stehule@gmail.com>:

2017-03-05 11:40 GMT+01:00 Jan Michálek <godzilalalala@gmail.com>:

I know, but, both new linestyles are created literally by cloning
ascii linestyle and few lines in print_aligned_text. Both works with
"aligned" and "wrapped" format. In rst is wrapped format useful, in my
opinion, in markdown i can`t find how I can get newline in record (maybe it
is not posiible in main markdown types). So it is why i add markdown and
rst as new linestyles. But it is not problem to change it in command to use
"\pset format", but i mean, that this is cleaner.

Using a special linestyle for new format is possible probably. But new
format should be switched with \pset format command.

changed

Not sure if wrapped or aligned behave is correct for markdown - it is
task for markdown processing, not for psql.

In this case I am inclined to prefer setting via format setting - you
can set a linestyle and border in one step, and then is easy to return back
to previous format. I don't see a big benefit in enhancing set of ascii
linestyles. The collecting new features in formatting is more intuitive
(for me).

This can be discussed what we prefer, and what we would to implement?

1. Nice formatted markdown tables

| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |

or 2. enough formatting

Markdown | Less | Pretty
--- | --- | ---
*Still* | `renders` | **nicely**
1 | 2 | 3

I personally prefer nice formated table, because more comfortable reading

source of document and easier editing with blocks (deleting whole columns
etc.).
I will change \pset to format.
I find, when adding <\br> for newline works in retext. I will try to add
it to patch.

| Tables | Are | Cool |

| ------------- |:-------------:| -----:|

| col 3 is | right-aligned | $1600 |

| col 2 is | centere<br/>d | $12 |

| zebra stripes | are neat | $1 |

Jan

Pavel

--
Jelen
Starší čeledín datovýho chlíva

--
Jelen
Starší čeledín datovýho chlíva

Attachments:

patch_markdown_rst.difftext/plain; charset=US-ASCII; name=patch_markdown_rst.diffDownload+163-9
#21Jan Michálek
godzilalalala@gmail.com
In reply to: Jan Michálek (#6)
#22Peter Eisentraut
peter_e@gmx.net
In reply to: Jan Michálek (#14)
#23Jan Michálek
godzilalalala@gmail.com
In reply to: Peter Eisentraut (#22)
#24Peter Eisentraut
peter_e@gmx.net
In reply to: Jan Michálek (#20)
#25Jan Michálek
godzilalalala@gmail.com
In reply to: Peter Eisentraut (#24)
#26Jan Michálek
godzilalalala@gmail.com
In reply to: Jan Michálek (#25)
#27Jan Michálek
godzilalalala@gmail.com
In reply to: Jan Michálek (#25)
#28Jan Michálek
godzilalalala@gmail.com
In reply to: Jan Michálek (#27)
#29Ideriha, Takeshi
ideriha.takeshi@jp.fujitsu.com
In reply to: Jan Michálek (#28)
#30Pavel Stehule
pavel.stehule@gmail.com
In reply to: Ideriha, Takeshi (#29)
#31Jan Michálek
godzilalalala@gmail.com
In reply to: Ideriha, Takeshi (#29)
#32Pavel Stehule
pavel.stehule@gmail.com
In reply to: Jan Michálek (#31)
#33Jan Michálek
godzilalalala@gmail.com
In reply to: Pavel Stehule (#32)
#34Ideriha, Takeshi
ideriha.takeshi@jp.fujitsu.com
In reply to: Jan Michálek (#31)
#35Pierre Ducroquet
p.psql@pinaraf.info
In reply to: Ideriha, Takeshi (#34)
#36Jan Michálek
godzilalalala@gmail.com
In reply to: Pierre Ducroquet (#35)
#37Jan Michálek
godzilalalala@gmail.com
In reply to: Pierre Ducroquet (#35)
#38Jan Michálek
godzilalalala@gmail.com
In reply to: Jan Michálek (#37)
#39Pavel Stehule
pavel.stehule@gmail.com
In reply to: Jan Michálek (#38)
#40Jan Michálek
godzilalalala@gmail.com
In reply to: Pavel Stehule (#39)
#41Pierre Ducroquet
p.sql@pinaraf.info
In reply to: Jan Michálek (#40)
#42Jan Michálek
godzilalalala@gmail.com
In reply to: Pierre Ducroquet (#41)
#43Jan Michálek
godzilalalala@gmail.com
In reply to: Pierre Ducroquet (#35)
#44Andres Freund
andres@anarazel.de
In reply to: Jan Michálek (#43)
#45Jan Michálek
godzilalalala@gmail.com
In reply to: Andres Freund (#44)
#46Andres Freund
andres@anarazel.de
In reply to: Jan Michálek (#45)
#47Fabien COELHO
coelho@cri.ensmp.fr
In reply to: Jan Michálek (#43)
#48Jan Michálek
godzilalalala@gmail.com
In reply to: Fabien COELHO (#47)
#49Jan Michálek
godzilalalala@gmail.com
In reply to: Fabien COELHO (#47)
#50Fabien COELHO
coelho@cri.ensmp.fr
In reply to: Jan Michálek (#49)
#51Jan Michálek
godzilalalala@gmail.com
In reply to: Fabien COELHO (#50)
#52Fabien COELHO
coelho@cri.ensmp.fr
In reply to: Jan Michálek (#51)
#53Jan Michálek
godzilalalala@gmail.com
In reply to: Fabien COELHO (#52)
#54Fabien COELHO
coelho@cri.ensmp.fr
In reply to: Jan Michálek (#53)
#55Jan Michálek
godzilalalala@gmail.com
In reply to: Fabien COELHO (#54)
#56Jan Michálek
godzilalalala@gmail.com
In reply to: Jan Michálek (#55)
#57Fabien COELHO
fabien.coelho@mines-paristech.fr
In reply to: Jan Michálek (#56)
#58Fabien COELHO
coelho@cri.ensmp.fr
In reply to: Jan Michálek (#56)
#59Daniel Gustafsson
daniel@yesql.se
In reply to: Fabien COELHO (#57)
#60Jan Michálek
godzilalalala@gmail.com
In reply to: Daniel Gustafsson (#59)
#61Daniel Gustafsson
daniel@yesql.se
In reply to: Jan Michálek (#60)
#62Jan Michálek
godzilalalala@gmail.com
In reply to: Daniel Gustafsson (#61)
#63Michael Paquier
michael@paquier.xyz
In reply to: Daniel Gustafsson (#61)
#64Jan Michálek
godzilalalala@gmail.com
In reply to: Michael Paquier (#63)
#65Daniel Gustafsson
daniel@yesql.se
In reply to: Jan Michálek (#64)
#66Jan Michálek
godzilalalala@gmail.com
In reply to: Daniel Gustafsson (#65)
#67Michael Paquier
michael@paquier.xyz
In reply to: Jan Michálek (#66)
#68Jan Michálek
godzilalalala@gmail.com
In reply to: Michael Paquier (#67)