From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: proposal (9.5) : psql unicode border line styles |
Date: | 2014-06-28 19:29:53 |
Message-ID: | CAFj8pRCzNo6kP3vyuZAJkakpcfb_aBRhSRaLcgjUjmpXno9M3A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hello
rebase for 9.5
test:
\pset linestyle unicode \pset border 2
\pset unicode_header_linestyle double
\l
Regards
Pavel
2014-03-11 21:17 GMT+01:00 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
> Hello
>
> I had to reduce allowed line style to single or double, because unicode
> allows only combination single,double or single,thick
>
> postgres=# \l
> List of databases
> Name | Owner | Encoding | Collate | Ctype | Access
> privileges
>
> -----------+----------+----------+-------------+-------------+-----------------------
> postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
> template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
> =c/postgres +
> | | | | |
> postgres=CTc/postgres
> template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
> =c/postgres +
> | | | | |
> postgres=CTc/postgres
> (3 rows)
>
> postgres=# \pset border 2
> Border style (border) is 2.
> postgres=# \pset linestyle unicode
> Line style (linestyle) is unicode.
> postgres=# \l
> List of databases
>
> ┌───────────┬──────────┬──────────┬─────────────┬─────────────┬───────────────────────┐
> │ Name │ Owner │ Encoding │ Collate │ Ctype │ Access
> privileges │
>
> ├───────────┼──────────┼──────────┼─────────────┼─────────────┼───────────────────────┤
> │ postgres │ postgres │ UTF8 │ en_US.UTF-8 │ en_US.UTF-8
> │ │
> │ template0 │ postgres │ UTF8 │ en_US.UTF-8 │ en_US.UTF-8 │
> =c/postgres ↵│
> │ │ │ │ │ │
> postgres=CTc/postgres │
> │ template1 │ postgres │ UTF8 │ en_US.UTF-8 │ en_US.UTF-8 │
> =c/postgres ↵│
> │ │ │ │ │ │
> postgres=CTc/postgres │
>
> └───────────┴──────────┴──────────┴─────────────┴─────────────┴───────────────────────┘
> (3 rows)
>
> postgres=# \pset unicode_header_linestyle double
> Unicode border linestyle is "double".
> postgres=# \l
> List of databases
>
> ┌───────────┬──────────┬──────────┬─────────────┬─────────────┬───────────────────────┐
> │ Name │ Owner │ Encoding │ Collate │ Ctype │ Access
> privileges │
>
> ╞═══════════╪══════════╪══════════╪═════════════╪═════════════╪═══════════════════════╡
> │ postgres │ postgres │ UTF8 │ en_US.UTF-8 │ en_US.UTF-8
> │ │
> │ template0 │ postgres │ UTF8 │ en_US.UTF-8 │ en_US.UTF-8 │
> =c/postgres ↵│
> │ │ │ │ │ │
> postgres=CTc/postgres │
> │ template1 │ postgres │ UTF8 │ en_US.UTF-8 │ en_US.UTF-8 │
> =c/postgres ↵│
> │ │ │ │ │ │
> postgres=CTc/postgres │
>
> └───────────┴──────────┴──────────┴─────────────┴─────────────┴───────────────────────┘
> (3 rows)
>
> postgres=#
>
> Regards
>
> Pavel
>
>
>
> 2014-03-07 19:24 GMT+01:00 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
>
> Hello
>>
>> I am returning back to this topic. Last time I proposed styles:
>>
>>
>> http://www.postgresql.org/message-id/CAFj8pRCLgoKtrYjPbToncpgyfTRcZ-ZgfOwdc1jquLB+eDe0Tw@mail.gmail.com
>>
>> http://postgres.cz/wiki/Pretty_borders_in_psql
>>
>> This experiment fails, but there are some interesting tips in discuss.
>>
>> So I propose little bit different proposal - choose one predefined style
>> for any table lines elements. These styles are active only when "linestyle"
>> is unicode.
>>
>> So possible line elements are:
>>
>> * border,
>> * header_separator,
>> * row_separator,
>> * column_separator,
>>
>> Possible styles (for each element)
>>
>> * none,
>> * single,
>> * double,
>> * thick,
>>
>> It should to have enough variability to define all styles proposed early.
>> I hope, so this proposal is secure and simple for usage. Styles should be
>> persistently saved in .psqlrc file - and some examples can be in
>> documentation.
>>
>> Usage:
>>
>> \pset linestyle_border double
>> \pset linestyle_header_separator single
>> \pset linestyle_row_separator single
>> \pset linestyle_column_separator single
>>
>> \pset linestyle unicode
>>
>> ╔═══╤════════════╤═══════╗
>> ║ a │ b │ c ║
>> ╟───┼────────────┼───────╢
>> ║ 1 │ 2012-05-24 │ Hello ║
>> ╟───┼────────────┼───────╢
>> ║ 2 │ 2012-05-25 │ Hello ║
>> ║ │ │ World ║
>> ╚═══╧════════════╧═══════╝
>> (2 rows)
>>
>>
>> Comments, ideas ?
>>
>> Regards
>>
>> Pavel
>>
>>
>>
>>
>>
>>
>>
>>
>
Attachment | Content-Type | Size |
---|---|---|
unicode_linestyle-01.patch | text/x-patch | 18.5 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Sim Zacks | 2014-06-28 19:41:23 | Re: Array of composite types returned from python |
Previous Message | Matheus de Oliveira | 2014-06-28 18:19:42 | Re: How about a proper TEMPORARY TABLESPACE? |