Other formats in pset like markdown, rst, mediawiki
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
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
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
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
Import Notes
Reply to msg id not found: 20170223185622.GG675@gmail.com | Resolved by subject fallback
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 todefault 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
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
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 todefault 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
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
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
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
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
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
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/>
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>
--
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
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/>
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>
--
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
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/>
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>
--
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
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 formatwrapped.
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 ispossible
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 registeryour
patch here:
https://commitfest.postgresql.org/13/
<https://commitfest.postgresql.org/13/>
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>
--
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
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 formatwrapped.
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 ispossible
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 developmentcycle
of Postgres 10
begins on the 1st of March, you need to to registeryour
patch here:
https://commitfest.postgresql.org/13/
<https://commitfest.postgresql.org/13/>
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>
--
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
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-posting2017-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
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-posting2017-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 | 3I 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
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-posting2017-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 | 3I 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