Re: printing table in asciidoc with psql

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: printing table in asciidoc with psql
Дата
Msg-id 20150323234435.GB11352@momjian.us
обсуждение исходный текст
Ответ на Re: printing table in asciidoc with psql  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: printing table in asciidoc with psql  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
On Sun, Mar 22, 2015 at 08:06:17PM +0900, Michael Paquier wrote:
> > I have updated the attached patch to do as you suggested.  Please also
> > test the \x output.  Thanks.
>
> Indeed. If I use a specific column name like this one, I am seeing
> problems with the expanded mode:
> =# create table "5 2.2+^.^" ("5 2.2+^.^" int);
> CREATE TABLE
> =# \x
> Expanded display is on.
> =# INSERT INTO "5 2.2+^.^" VALUES (1);
> INSERT 0 1
> =# table "5 2.2+^.^";
>
> [cols="h,l",frame="none"]
> |====
> 2+^|Record 1
> <|5 2.2+^.^ >|1
> |====
>
> In this case the record is printed like that:
> 5 2.2+.
> While it should show up like that:
> 5 2.2+^.^

OK, fixed.  It turns out you need to specify the style on each output
row ('l'/literal) so that a later data value of ^.^ is not intepreted as
a horizontal/vertial alignment specification.  (Wow, it sounds like I
know what I am talking about.  ;-) )

The new output is:

    test=> \pset format asciidoc
    Output format is asciidoc.
    test=> \x
    Expanded display is on.
    test=> table "5 2.2+^.^";

    [cols="h,l",frame="none"]
    |====
    2+^|Record 1
-->    <l|5 2.2+^.^ >|1
    |====

Notice the added 'l' next to the '<'.  Updated patch attached.  Any
other issues?

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Abbreviated keys for Numeric
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Abbreviated keys for Numeric