Re: Getting our tables to render better in PDF output

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Alexander Lakhin <exclusion(at)gmail(dot)com>, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Getting our tables to render better in PDF output
Date: 2020-02-13 00:56:33
Message-ID: 23574.1581555393@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> Yeah, it'd look very odd, and certainly the no-parens case makes it
> worse. I like this end result:

>> Function Signature
>> age age(timestamp) → interval
>> now now() → timestamp with time zone
>> current_timestamp current_timestamp → timestamp with time zone

I gave that a try, and it seems to work really well. It can even handle
the ridiculously long signature for make_interval() in reasonable style,
as shown in the screenshot attached.

One problem with the rightarrow idea is that it's not rendering quite
right for me: it looks great in HTML, but in PDF it comes out flush
with the baseline, as you can see in the screenshot. Hopefully
there's a way to fix that that we can hide in the custom entity ...
but I have no idea how.

I decided to try converting the date/time operators table too, to
see how well this works for that. It's bulkier than before, but
also (I think) more precise. I realized that this table actually
had three examples already for float8 * interval, but it wasn't
at all obvious that they were the same operator. So that aspect
is a lot nicer here. On the other hand, it seems like the text
descriptions are only marginally useful here. I can imagine that
they would be useful in some other operator tables, such as
geometric operators, but I'm a bit tempted to leave them out
in this particular table. The format would adapt to that easily.

Another thing worth considering is removing duplicate left-hand-
column entries, that is, considering all the instances of
similarly-named functions/operators to be "the same". In the
attached patch, I did that for isfinite() but not anywhere else.
I'm not quite sure if it's a good idea or not. It seems like it
makes sense for isfinite(), but perhaps less so for operators.

Again, comments welcome. This is starting to feel like a real
proposal now, but I'm still not at all wedded to it.

regards, tom lane

Attachment Content-Type Size
better-function-tables-wip.patch text/x-diff 59.9 KB
table-9-31-take2.png image/png 294.5 KB

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Alexander Lakhin 2020-02-13 05:00:02 Re: Getting our tables to render better in PDF output
Previous Message PG Doc comments form 2020-02-12 23:55:51 pg_buffercache query example results misleading, grouping by just relname, needs schema_name