Re: Other formats in pset like markdown, rst, mediawiki

From: Jan Michálek <godzilalalala(at)gmail(dot)com>
To: Pierre Ducroquet <p(dot)sql(at)pinaraf(dot)info>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Other formats in pset like markdown, rst, mediawiki
Date: 2017-03-31 13:59:23
Message-ID: CAAYBy8aZZRxENc6D1Sp1owhKCFVg-Bjh-y77q=iJg7Qt111HDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2017-03-31 12:01 GMT+02:00 Pierre Ducroquet <p(dot)sql(at)pinaraf(dot)info>:

> On Friday, March 31, 2017 7:17:08 AM CEST, Jan Michálek wrote:
>
>>
>>
>> 2017-03-30 21:53 GMT+02:00 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
>>
>>
>> 2017-03-29 20:11 GMT+02:00 Jan Michálek <godzilalalala(at)gmail(dot)com>:
>>
>>
>> 2017-03-27 19:41 GMT+02:00 Jan Michálek <godzilalalala(at)gmail(dot)com>:
>>
>>
>> 2017-03-23 17:26 GMT+01:00 Pierre Ducroquet <p(dot)psql(at)pinaraf(dot)info>:
>> The following review has been posted through the commitfest application:
>> make installcheck-world: tested, passed
>> Implements feature: tested, passed
>> Spec compliant: tested, passed
>> Documentation: tested, passed
>>
>> Hi
>>
>> This is my first review (Magnus said in his presentation in PGDay Paris
>> that volunteers should just come and help, so here I am), so please notify
>> me for any mistake I do when using the review tools...
>>
>> The feature seems to work as expected, but I don't claim to be a markdown
>> and rst expert.
>> Some minor issues with the code itself :
>> - some indentation issues (documentation and code itself with mix between
>> space based and tab based indentation) and a few trailing spaces in code
>>
>> corrected
>> - typographic issues in the documentation :
>> - "The html, asciidoc, latex, latex-longtable, troff-ms, and markdown
>> and rst formats" ==> duplicated and
>>
>> corrected - "Sets the output format to one of unaligned, aligned,
>> wrapped, html, asciidoc, latex (uses tabular), latex-longtable, rst,
>> markdown, or troff-ms." ==> extra comma at the end of the list
>> - the comment " dont add line after last row, because line is added after
>> every row" is misleading, it should warn that it's only for rst
>> - there is a block of commented out code left
>> - in the print_aligned_vertical function, there is a mix between
>> "cont->opt->format == PRINT_RST" and "format == &pg_rst" and I don't see
>> any obvious reason for that
>> corrected - the documentation doesn't mention (but ok, it's kind of
>> obvious) that the linestyle option will not work with rst and markdown
>>
>>
>> In this patch are corrected (i hope, i had correct changes in vimrc)
>> indentation issues. Plese, look at this if it is OK (i men indentats) and
>> some minor errors. And it should work on current master (probably).
>>
>> Added \x option form markdown
>> In markdown works multiline cels (newline replaced by </br>)
>> regre tests passed
>>
>> \pset format rst
>> \x
>> select 10
>> crash on segfault
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x00007f77673a866c in vfprintf () from /lib64/libc.so.6
>> (gdb) bt
>> #0 0x00007f77673a866c in vfprintf () from /lib64/libc.so.6
>> #1 0x00007f77673b1574 in fprintf () from /lib64/libc.so.6
>> #2 0x0000000000437bc5 in print_aligned_vertical (cont=0x7fffade43da0,
>> fout=<optimized out>, is_pager=<optimized out>) at print.c:1755
>> #3 0x000000000043a70d in printTable (cont=cont(at)entry=0x7fffade43da0,
>> fout=<optimized out>, fout(at)entry=0x7f77677255e0 <_IO_2_1_stdout_>,
>> is_pager=<optimized out>, is_pager(at)entry=0 '\000', flog=flog(at)entry=0x0)
>> at print.c:3466
>> #4 0x000000000043c37f in printQuery (result=result(at)entry=0x9c4b60,
>> opt=opt(at)entry=0x7fffade43f00, fout=0x7f77677255e0 <_IO_2_1_stdout_>,
>> is_pager=is_pager(at)entry=0 '\000', flog=0x0) at print.c:3551
>> #5 0x000000000040da6d in PrintQueryTuples (results=0x9c4b60) at
>> common.c:808
>> #6 PrintQueryResults (results=0x9c4b60) at common.c:1140
>> #7 SendQuery (query=0x9c1700 "select 10;") at common.c:1317
>> #8 0x000000000041c3d4 in MainLoop (source=0x7f77677248a0
>> <_IO_2_1_stdin_>) at mainloop.c:319
>> #9 0x0000000000405d5d in main (argc=<optimized out>, argv=<optimized
>> out>) at startup.c:396
>>
>> Regards
>>
>> On source from monday it works (last commit on master I have is from 27.3
>> 14:30). Or, maybe I didn`t generate diff well, or some gitt issue.
>>
>
> I agree with Pavel, there is a segfault when you do these with your
> current patch. The current patch does not pass make check-world.
> How did you generate the diff ? Basically, the simplest way to generate a
> patch serie is through git format-patch.
> For instance, say you have a rstFormat branch freshly rebased upon
> origin/master, just do git format-patch origin/master..rstFormat and you
> will have one patch file per commit.
> And don't forget to commit everything :)
>
> I hope this helps, I don't have enough time to go through the patch and
> find out what is causing the segfault right now.
>

There was error in code (I don`t know why it works on my computer). Pavel
found this error and there is corrected patch.

Thanks

Jan

P.S.: There are few things i should change (linestyle comment, few things
in documentation, table annotation etc), so I didn`t change state of patch.

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

Attachment Content-Type Size
psql-markdown-rst.patch text/x-patch 42.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-03-31 13:59:35 Re: Fix obsolete comment in GetSnapshotData
Previous Message Robert Haas 2017-03-31 13:42:31 Re: logical replication launcher crash on buildfarm