Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jVinu-00064m-3e for pgsql-hackers@arkaria.postgresql.org; Mon, 04 May 2020 21:39:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jVins-0004DF-Vw for pgsql-hackers@arkaria.postgresql.org; Mon, 04 May 2020 21:39:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jVins-0004D8-Ar for pgsql-hackers@lists.postgresql.org; Mon, 04 May 2020 21:39:08 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jVino-0004UY-IA for pgsql-hackers@lists.postgresql.org; Mon, 04 May 2020 21:39:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=N//FJqIkNN/02l+gfPptNKDeGCFR/8orc5mMY/RJ0oM=; b=iWzzM0xYKNv/aI+mrMsUU9ETgj F1eNUUN3CwumeH9Y14WJB7XlWdWZ2EdFrGLnQG05eyg6jX4qtof/swXj5g4V+TqP7YpaDCUh7GsMb 8Gkvk9u1lY9nn+dAMhhysqelhucyfluN6EsTNaYKbsVJnGVlqVFurcAbeA4beWjTozDwXTY884K+Z s/klCgieej+FkUIuU6I0s8vh1eHUhHy1d332AduyJHfmv70vCRODyO6hytKOBJCCgDxRCrmsRKw1A WvN/LU33czhF42XD94b1VE/vkQSMbQXAmsYKzIouTCGt6YjexJ/EdtLcJssEdlJUyY+B/43iO8UVO 8cQay60g==; Received: from pool-173-56-10-231.nycmny.fios.verizon.net ([173.56.10.231] helo=Ph33rHippo.local) by meldrar.postgresql.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jVinl-0006Ic-Ha; Mon, 04 May 2020 21:39:04 +0000 Subject: Re: Poll: are people okay with function/operator table redesign? To: Tom Lane Cc: Peter Eisentraut , Bruce Momjian , Alvaro Herrera , Robert Haas , Steven Pousty , Pavel Stehule , Isaac Morland , Pierre Giraud , PostgreSQL Developers References: <20200423174343.GA16996@alvherre.pgsql> <19233.1587665407@sss.pgh.pa.us> <5561.1587922854@sss.pgh.pa.us> <13e5e408-bc59-e8ca-44f3-28a981b4fc7d@postgresql.org> <11211.1587951842@sss.pgh.pa.us> <58de9544-be5b-f325-b5cc-cce4e2dda7d9@postgresql.org> <5651.1587991781@sss.pgh.pa.us> <30469.1588087170@sss.pgh.pa.us> <8682.1588202983@sss.pgh.pa.us> <4894cde4-148d-f0cc-d6d8-182a46f13e1b@postgresql.org> <06f6b32d-a4cc-3723-5bc1-00fa674df961@postgresql.org> <11106.1588205727@sss.pgh.pa.us> <1c5ca197-f7f2-0300-46ce-4652c7f81d48@postgresql.org> <18310.1588214299@sss.pgh.pa.us> <20585.1588217180@sss.pgh.pa.us> <751.1588627321@sss.pgh.pa.us> From: "Jonathan S. Katz" Autocrypt: addr=jkatz@postgresql.org; keydata= mQINBFtShwABEAC7PNHDUOTYuifpUCk23KqfxdQQkn4nkoxOXRK0+rAj36FiwqGB4TJFuOVZ sDFAEiSlC8Jt4y5Cs7B5tetT8JNd2cs6zp/udMJJDz9d65O9PDpdlMgAmIiTzpLlSdx8FG56 DTksaDv1d8j3cTJPSE4/fWSxqzA7o3Y9UuL7atZPrzfImgpRKs0of7elIHwOa8GucjyhYqcR h60wFBJc2KXqQdDYRTZy43DSnY/0VNc0omiH355fustvpm+m5HjD3w7qZyfN3fpK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stZID+WgAAa1JLfChMyVQnSy 0zfWMOABXscc5tGuvFRZvJklTissMFjXUwaREEKp4ZikTvJ/62MCjSdtrUhnPLvoTsHTKRKD ichE+b5A54alwsubTijw12O6N22r5IjZiiSZV0u7dsShyKw+7wCSax9fuBoE43NMYf+dnjMK nerAQYUcZWYMnk+EC8RaqYAxv6XZ2tKx1AkGGktwkQIBwrz9IlDSvJ3LWJ2UIIuLRTdngNgg GIL4zzuUa2F56FqskQIuYMaNETk6LYfalBDQ6TVLAcgCPQxp4k4i/PRsZ3lZ2ZhRHRYciOvm kp+I6EfHwllQpYrWs1thluBGqlJSVJgKl0IOFvKLsQ6KKfqzAwh6FxrO5qajp4viNIgtWoFw O5Bp0jgFTbH2OrMWIRfUdUCH1Djbuo65svhNj7FNsQVYzHDI+Nd1I/LOBoPc3UorRMF2M4JV kUR7skOHWUbPTSNUr7qc14NSMY3PKjGeVGAsBVHBPvmRx/Ss2tW/TpJWpxg4pmquFQSXuaYh Yf4FN8Sxy320pcr+FqN8AhZkYJcNY82OTtR5VEKRC/mYcyq61qXIKqngydn79bJjGxHipxyF FmEC Message-ID: <251a3aa4-c59b-4d16-d515-7e2252579431@postgresql.org> Date: Mon, 4 May 2020 17:38:55 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <751.1588627321@sss.pgh.pa.us> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="L0wYzlSuRqSoUw4mmTM704ecFYf0Y46cL" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --L0wYzlSuRqSoUw4mmTM704ecFYf0Y46cL Content-Type: multipart/mixed; boundary="9fANfF5BG0qZEsgFbjTrDX1eyOrMVRdtG" --9fANfF5BG0qZEsgFbjTrDX1eyOrMVRdtG Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 5/4/20 5:22 PM, Tom Lane wrote: > I've now completed updating chapter 9 for the new layout, > and the results are visible at=20 > https://www.postgresql.org/docs/devel/functions.html > There is more to do --- for instance, various contrib modules > have function/operator tables that should be synced with this > design. But this seemed like a good place to pause and reflect. This is already much better. I've skimmed through a few of the pages, I can say that the aggregates page[1] is WAY easier to read. Yay! >=20 > After working through the whole chapter, the only aspect of the > new markup that really doesn't seem to work so well is the use > of for function result types and example results. > While I don't think that that's broken in concept, DocBook has > restrictions on the contents of that are problematic: >=20 > * It won't let you put any verbatim-layout environment, such > as , inside . This is an issue for > examples for set-returning functions in particular. I've done > those like this: >=20 > > regexp_matches('foobarbequebaz', 'ba.', 'g')= > > > {bar} > {baz} > > (2 rows in result) > >=20 > where the empty environment is just serving to generate a= > right arrow. It looks all right, but it's hardly semantically-based > markup. We could apply some CSS on the pgweb front perhaps to help distinguish at least the results? For the above example, it would be great to capture the program listing + "2 rows in result" output and format them similarly, though it appears the "(2 rows in result)" is in its own block= =2E Anyway, likely not that hard to apply some CSS and make it appear a bit more distinguished, if that's the general idea. > * is also quite sticky about inserting other sorts > of font-changing environments inside it. As an example, it'll let > you include but not , which seems pretty weird > to me. This is problematic in some places where it's desirable to > have text rather than just a type name, for example >=20 > stddev ( numeric_type ) > double precision > for real or double precision, > otherwise numeric >=20 > Now I could have done this example by spelling out all six varieties of= > stddev() separately, and maybe I should've, but it seemed overly bulky > that way. So again is just generating the right arrow. >=20 > * After experimenting with a few different ways to handle functions wit= h > multiple OUT parameters, I settled on doing it like this: >=20 > pg_partition_tree ( regclass = ) > setof record > ( relid regclass, > parentrelid regclass, > isleaf boolean, > level integer ) >=20 > This looks nice and I think it's much more intelligible than other > things I tried --- in particular, including the OUT parameters in > the function signature seems to me to be mostly confusing. But, > once again, it's abusing the concept that contains > the result type. Ideally the output-column list would be inside > the environment, but DocBook won't allow that > because of the tags. It does look better, but things look a bit smushed together on the pgweb front. It seems like there's enough structure where one can make some not-too-zany CSS rules to put a bit more space between elements, but perhaps wait to hear the decision on the rest of the structural questions= =2E > So at this point I'm tempted to abandon and go back > to using a custom entity to generate the right arrow, so that > the markup would just look like, say, >=20 > stddev ( numeric_type ) > &returns; double precision > for real or double precision, > otherwise numeric >=20 > Does anyone have a preference on that, or a better alternative? As long as we can properly style without zany CSS rules, I'm +0 :) Jonathan [1] https://www.postgresql.org/docs/devel/functions-aggregate.html --9fANfF5BG0qZEsgFbjTrDX1eyOrMVRdtG-- --L0wYzlSuRqSoUw4mmTM704ecFYf0Y46cL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE+oS2la8r95ogZD/x8QSccp8cZScFAl6wi3AACgkQ8QSccp8c ZSfJcA//eRePg/ienjFK93PT/UK9KjDP3gRdlwDufdL1KqQsUyQBWPhOiFtjJ/Fu Z0tE1xUXuS2qb67ghWnB+aPYhQ6fKJ9AH+Ycdf6NMqNV/WiEgRMLUxLqCGORacwQ lEBDYUYlPdLV+E7a61jI25Dyud6lQoZupAmETBqJHuzkOHJZJIyi6FfS8Rqxy/PH 74B1CBDa/fNo1CwNX+gu2HqjeRt3FD5pK0Gh8tCOhWNIpNyhMmqh7Zt9gQCoYk+Y T9rOuHMP+Nj3vqORRL1xEX0mRMJxknCbZ8KSx/CF86Zc5lESlgK0u8GC6gPTTej7 etuUjM3eNWYgtKCvgZbdmQKK0/beq/f4yoP7IOX7RIo155FPExQik8ZhItD8PyN3 EFoKbFBZkkX1Ru6Tu+zDxf55tcyzcWz1FtMHWxe7SVEJtQVM6x203833DviGwS5M APUtJTDrBIdxEwsOWKtEqfQ9XMkEhBti8TbeYTmy/Fmy/9ByL5Acjd/gSvBhB838 qlmn6TMG2SIHD8Ns0LmsH9V3ytXb/mRveYzj2os01i4m8Pzfic4AN15rJ72eN/D/ lOz0HsWxRJuuz8LOuPXY7ewIzIznquo+sDXTwzW2exq/QAdHfK4h9wFMMA8DrKey 7yCdWpX7pyTd7O5FilqEa/CLrMoBDtY4zkwHJRS66sGICjXQ5HQ= =j8tf -----END PGP SIGNATURE----- --L0wYzlSuRqSoUw4mmTM704ecFYf0Y46cL--