Обсуждение: expanded mode is still broken

Поиск
Список
Период
Сортировка

expanded mode is still broken

От
Pavel Stehule
Дата:
Hi

I checked HEAD and border formatting is broken


postgres=# \pset border 3
Border style (border) is 3.
postgres=# \l
List of databases
[ RECORD 1 ]-----+----------------------
| Name              | postgres              |
| Owner             | postgres              |
| Encoding          | UTF8                  |
| Collate           | en_US.UTF-8           |
| Ctype             | en_US.UTF-8           |
| Access privileges |                       |
[ RECORD 2 ]-----+----------------------
| Name              | template0             |
| Owner             | postgres              |
| Encoding          | UTF8                  |
| Collate           | en_US.UTF-8           |
| Ctype             | en_US.UTF-8           |
| Access privileges | =c/postgres          +|
|                   | postgres=CTc/postgres |
[ RECORD 3 ]-----+----------------------
| Name              | template1             |
| Owner             | postgres              |
| Encoding          | UTF8                  |
| Collate           | en_US.UTF-8           |
| Ctype             | en_US.UTF-8           |
| Access privileges | =c/postgres          +|
|                   | postgres=CTc/postgres |
-----------------+----------------------

postgres=# \pset linestyle unicode
Line style (linestyle) is unicode.
postgres=# \l
List of databases
[ RECORD 1 ]─────┬──────────────────────
│ Name              │ postgres              │
│ Owner             │ postgres              │
│ Encoding          │ UTF8                  │
│ Collate           │ en_US.UTF-8           │
│ Ctype             │ en_US.UTF-8           │
│ Access privileges │                       │
[ RECORD 2 ]─────┼──────────────────────
│ Name              │ template0             │
│ Owner             │ postgres              │
│ Encoding          │ UTF8                  │
│ Collate           │ en_US.UTF-8           │
│ Ctype             │ en_US.UTF-8           │
│ Access privileges │ =c/postgres          ↵│
│                   │ postgres=CTc/postgres │
[ RECORD 3 ]─────┼──────────────────────
│ Name              │ template1             │
│ Owner             │ postgres              │
│ Encoding          │ UTF8                  │
│ Collate           │ en_US.UTF-8           │
│ Ctype             │ en_US.UTF-8           │
│ Access privileges │ =c/postgres          ↵│
│                   │ postgres=CTc/postgres │
─────────────────┴──────────────────────

Probably not all Sergey's fixes was applied, when I tested it (9.4 with Sergey' fixes) it works without issues (I though)

Regards

Pavel

Re: expanded mode is still broken

От
Stephen Frost
Дата:
Pavel,

* Pavel Stehule (pavel.stehule@gmail.com) wrote:
> I checked HEAD and border formatting is broken

I agree that 'border 3' and the ascii / unicode linestyles generates an
odd looking output, however...

[...]

> Probably not all Sergey's fixes was applied, when I tested it (9.4 with
> Sergey' fixes) it works without issues (I though)

I went through all of psql-wrapped-expanded-fix-v5.patch (from
CAJTaR30koAru2tucYiAZ=JjFFi8TZ0K7dhfSY-y7bsFj347zdg@mail.gmail.com) and
the whole thing appears to have been applied.  There aren't any
regression tests with '\pset border 3' and the documentation indicates
that it's only sensible for HTML (where it simply tranlates into the
border=.. attribute) and latex/latex-longtable.  That said, it looks
like it worked in 9.3.  I'm guessing there's a case somewhere which
isn't handling border = 3 as identical to border = 2 after these changes.

If there's a specific patch that fixes this, please share a link.  I'll
spend a bit of time looking at it, but I'll admit that I've not spent a
lot of time in this code and it isn't exactly the most straight-forward
code in our tree today..
Thanks,
    Stephen

Re: expanded mode is still broken

От
Stephen Frost
Дата:
Pavel,

* Stephen Frost (sfrost@snowman.net) wrote:
> That said, it looks like it worked in 9.3.

Hmm, actually, no, it didn't.

sfrost@tamriel:~> psql --version
psql (PostgreSQL) 9.3.5
sfrost@tamriel:~> psql -d postgres
psql (9.3.5)
Type "help" for help.

postgres=# \pset expanded
Expanded display is on.
postgres=# \pset border 3
Border style is 3.
postgres=# \l
List of databases
[ RECORD 1 ]-----+----------------------
| Name              | postgres              |
| Owner             | postgres              |
| Encoding          | UTF8                  |
| Collate           | en_US.UTF-8           |
| Ctype             | en_US.UTF-8           |
| Access privileges |                       |

...

I've found a few places where we don't treat border >= 2 as the same
border == 2 and if I'm able to make it work then I'll probably go ahead
and commit it, unless anyone objects, but if I run into trouble then
I'll probably just punt on it as I don't know that it really deserves a
lot of effort.

The way the documentation reads for 'border' is pretty terrible though,
in my view, so I'll take a pass at cleaning that up too.
Thanks,
    Stephen

Re: expanded mode is still broken

От
Stephen Frost
Дата:
Pavel, All,

* Stephen Frost (sfrost@snowman.net) wrote:
> * Stephen Frost (sfrost@snowman.net) wrote:
> > That said, it looks like it worked in 9.3.
>
> Hmm, actually, no, it didn't.
[...]

Alright, attached is a patch which fixes it.  Barring objections, I'll
go ahead and back-patch this also, since it's clearly wrong and there
was a definite attempt to have this case work (a few places explicitly
reset opt_border to 2 if it's higher, but that wasn't being passed down
to print_aligned_vertical_line, and it wasn't doing it).

    Thanks,

        Stephen

Вложения

Re: expanded mode is still broken

От
Pavel Stehule
Дата:
It works perfectly now

Thank you

Pavel

2014-09-12 16:37 GMT+02:00 Stephen Frost <sfrost@snowman.net>:
Pavel, All,

* Stephen Frost (sfrost@snowman.net) wrote:
> * Stephen Frost (sfrost@snowman.net) wrote:
> > That said, it looks like it worked in 9.3.
>
> Hmm, actually, no, it didn't.
[...]

Alright, attached is a patch which fixes it.  Barring objections, I'll
go ahead and back-patch this also, since it's clearly wrong and there
was a definite attempt to have this case work (a few places explicitly
reset opt_border to 2 if it's higher, but that wasn't being passed down
to print_aligned_vertical_line, and it wasn't doing it).

        Thanks,

                Stephen