Re: Typo in "43.9.1. Reporting Errors and Messages"?

2023-10-31 Thread Alexander Lakhin

Hi Bruce,

31.10.2023 17:52, Bruce Momjian wrote:



It is referring to the internal constant (see src/backend/utils/errcodes.h). It
was like you are proposing and it was changed in
66bde49d96a9ddacc49dcbdf1b47b5bd6e31ead5. Reading the original thread, there is
no explanation why it was changed. Refer to internal names is not good for a
user-oriented text. I think it would be better to use the condition name (in
lowercase) like it is referred to in [1]. I mean, change
ERRCODE_RAISE_EXCEPTION to raise_exception.

[1] https://www.postgresql.org/docs/current/errcodes-appendix.html

Alexander, Michael, can you explain why this commit removed ERRCODE_:

commit 66bde49d96


I don't remember details, but I think the primary reason for the change
was that "RAISE_EXCEPTION" occurred in the whole tree only once (before
66bde49d96). Now I see, that I had chosen the wrong replacement — I agree
with Euler, change to "raise_exception" would be more appropriate.

(I've found a similar mention of ERRCODE_xxx in btree.sgml:
  Before doing so, the function should check the sign
  of offset: if it is less than zero, raise
  error ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE (22013)
  with error text like invalid preceding or following size in window
  function.
but I think that's okay here, because that identifier supposed to be used
as-is in ereport/elog.)

Best regards,
Alexander




Re: nested tags in glossary entries in html docs

2024-04-25 Thread Alexander Lakhin

Hello,

25.04.2024 12:24, Alvaro Herrera wrote:

On 2024-Apr-12, Erik Wienhold wrote:


There's this bug[1] in the DocBook XSLT stylesheets.  Looks like the
fix[2] landed in 1.79.2 (latest version on Arch,

Maybe one of these days we should get going with the migration to
Docbook 5.x that Jürgen Purtz proposed.

https://postgr.es/m/21ed3fd9-9020-4b53-b04f-a08a831b6...@purtz.de

In the meantime, if anyone wants to suggest a XSLT patch to carry in our
local definition, we could try that.


Please try the attached patch, which adds , borrowed from /usr/share/xml/docbook/stylesheet/
docbook-xsl/xhtml/inline.xsl (I have docbook-xsl 1.79.2 installed), to our
local stylesheet-html-common.xsl.

I applied the modification from [1] (in two places) and it looks like the
nested  issue is gone.

[1] 
https://github.com/docbook/xslt10-stylesheets/pull/72/commits/62144252364492aecd71a3c8d5e6e1624af84785

Best regards,
Alexanderdiff --git a/doc/src/sgml/stylesheet-html-common.xsl b/doc/src/sgml/stylesheet-html-common.xsl
index 9dcf96c02e..641a384812 100644
--- a/doc/src/sgml/stylesheet-html-common.xsl
+++ b/doc/src/sgml/stylesheet-html-common.xsl
@@ -674,4 +674,163 @@ set   toc,title
   
 
 
+
+  
+
+  
+  
+
+  
+
+  
+
+  
+  
+
+  
+
+  
+
+  
+
+  
+
+
+
+  
+
+  
+
+
+
+  
+
+  
+
+
+  
+
+  
+
+  
+
+
+
+  
+
+  
+  
+
+  
+
+  
+
+  
+  
+
+  
+
+  
+
+  Warning: glossary.collection specified, but there are 
+  
+   automatic glossaries
+
+  
+
+  
+
+  
+
+  
+
+  
+
+  
+
+  
+  
+
+  
+
+  
+
+  
+
+  
+There's no entry for 
+
+ in 
+
+  
+  
+
+
+  
+
+  
+
+  
+  
+
+
+  
+
+  
+
+  
+
+
+
+  
+
+  
+
+  
+  
+
+  
+
+  
+  
+  
+
+  
+
+  
+Error: no glossentry for glossterm: 
+
+.
+  
+  
+
+
+  
+
+
+  
+
+  
+
+
+
+  
+
+  
+
+
+
+  
+
+  
+
+  
+
+
+
+  
+
+  
+
+
 


Re: MacPorts xsltproc is very slow?

2017-11-24 Thread Alexander Lakhin

Hello Thomas,

25.11.2017 06:38, Thomas Munro wrote:

Hi,

Does anyone know why I'd see this difference in "make docs" performance?

Can you show the output of
make XSLTPROCFLAGS="--profile" -C doc/src/sgml/html
or
make XSLTPROCFLAGS="--profile" docs
?

--
Alexander Lakhin
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


Re: [DOCS] Docbook 5.x

2017-11-24 Thread Alexander Lakhin

Hello,
23.11.2017 17:53, Peter Eisentraut wrote:

On 11/15/17 16:06, Peter Eisentraut wrote:
Here is the final patch set for the conversion. 

I have committed this.

Great! Thank you for your work!
And in light of possible need to convert to xml older branches too, 
maybe we should simplify INSTALL now.
Please, consider applying the attached patch. It produces the same 
INSTALL and is much better in the following aspects.


1. All the INSTALL content is placed in two files (installation.sgml and 
installation-single.xsl) instead of three (installation.sgml, 
standalone-install.xml, standalone-profile.xsl).
2. There are no unreadable and untranslatable (in context) constructions 
such as


  the 
PL/Python 
documentation


(Sometimes translators need to replace larger fragments.)
3. It uses only XSLT (which we use already), no xi:include.
4. It doesn't generate complete postgres.sgml to process only the 
installation section.


I understand that it will take some time to review it, but I think it's 
justified by the portability and supportability reasons.


Best regards,

--
Alexander Lakhin
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile
index f122b41..0cf3afe 100644
--- a/doc/src/sgml/Makefile
+++ b/doc/src/sgml/Makefile
@@ -111,13 +111,8 @@ LYNX = lynx
 INSTALL: % : %.html
 	$(PERL) -p -e 's, $@
 
-INSTALL.html: %.html : stylesheet-text.xsl %.xml
-	$(XMLLINT) --noout --valid $*.xml
-	$(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) $^ >$@
-
-INSTALL.xml: standalone-profile.xsl standalone-install.xml postgres.sgml $(ALLSGML)
-	$(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) --xinclude $(wordlist 1,2,$^) >$@
-
+INSTALL.html: installation.sgml installation-single.xsl stylesheet-text.xsl
+	sed -e "s/&version;/$(VERSION)/" $< | $(XSLTPROC) $(XSLTPROCFLAGS) $(word 2,$^) - | $(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) $(word 3,$^) - >$@
 
 ##
 ## HTML
diff --git a/doc/src/sgml/installation-single.xsl b/doc/src/sgml/installation-single.xsl
new file mode 100644
index 000..d8f45b5
--- /dev/null
+++ b/doc/src/sgml/installation-single.xsl
@@ -0,0 +1,202 @@
+
+
+%version;
+]>
+
+http://www.w3.org/1999/XSL/Transform";
+version="1.0">
+
+
+
+http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"/>
+
+
+  
+
+  
+
+
+
+
+
+ PostgreSQL Installation from Source Code
+
+ 
+  This document describes the installation of
+  PostgreSQL using this source code distribution.
+ 
+
+ 
+ 
+ 
+ 
+
+ 
+  Getting Started
+
+  
+   The following is a quick summary of how to get PostgreSQL up and
+   running once installed. The main documentation contains more information.
+  
+
+  
+   
+
+ Create a user account for the PostgreSQL
+ server. This is the user the server will run as. For production
+ use you should create a separate, unprivileged account
+ (postgres is commonly used). If you do not have root
+ access or just want to play around, your own user account is
+ enough, but running the server as root is a security risk and
+ will not work.
+adduser postgres
+
+   
+
+   
+
+ Create a database installation with the initdb
+ command. To run initdb you must be logged in to your
+ PostgreSQL server account. It will not work as
+ root.
+root# mkdir /usr/local/pgsql/data
+root# chown postgres /usr/local/pgsql/data
+root# su - postgres
+postgres$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
+
+
+
+ The -D option specifies the location where the data
+ will be stored. You can use any path you want, it does not have
+ to be under the installation directory. Just make sure that the
+ server account can write to the directory (or create it, if it
+ doesn't already exist) before starting initdb, as
+ illustrated here.
+
+   
+
+   
+
+ At this point, if you did not use the initdb -A
+ option, you might want to modify pg_hba.conf to control
+ local access to the server before you start it.  The default is to
+ trust all local users.
+
+   
+
+   
+
+ The previous initdb step should have told you how to
+ start up the database server. Do so now. The command should look
+ something like:
+/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data
+ This will start the server in the foreground. To put the server
+ in the background use something like:
+nohup /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data \
+</dev/null >>server.log 2>&1 </dev/null &
+
+
+
+ To stop a server running in the background you can type:
+kill `cat /usr/local/pgsql/data/postmaster.pid`
+
+   
+
+   
+
+ Create a database:
+createdb testdb
+ Then enter:
+psql testdb
+ to connect to that database. At the prompt you can enter SQL
+ commands and start experimenti

Re: MacPorts xsltproc is very slow?

2017-11-24 Thread Alexander Lakhin

25.11.2017 07:49, Thomas Munro wrote:
On Sat, Nov 25, 2017 at 4:57 PM, Alexander Lakhin 
 wrote:
Can you show the output of make XSLTPROCFLAGS="--profile" -C 
doc/src/sgml/html or make XSLTPROCFLAGS="--profile" docs ? 
Hi Alexander, please see attached. 

Thanks! Just to compare your results with my:
number   match    name  mode  Calls Tot 
100us  Avg
    0       d:appendix label.markup 22503 70018988  
3111

    1               chunk-all-sections 1394 36361616 26084
    2       d:chapter  label.markup 24918 
20792834   834
    3          href.target    23895 
18556477   776
    4   footer.navigation  1394 
5276429  3785
    5    header.navigation 1394 
5095535  3655
    6 gentext.template   237071 857659  
   3


vs

number   match    name  mode  Calls Tot 
100us Avg


    0 gentext.template 247659    742878    2
    1   chunk-all-sections 1394    705195  505
    2  href.target 35446    663090   18

I wonder, what version of docbook-xsl are you using?
(I have 1.79.1+dfsg-1).
Can you check with 1.79+ (if yours is older)?

------
Alexander Lakhin
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company



Re: MacPorts xsltproc is very slow?

2017-11-25 Thread Alexander Lakhin


25.11.2017 11:03, Thomas Munro wrote:


Hmm.  Well, this is all new to me but I'd have expected the numbers in
the "Calls" column to be entirely deterministic.
I think, calls are depending on the XSL templates and it seems we have 
different templates.
(I couldn't find 'd:appendix' in my docbook-xsl installation, that's why 
I asked about version number.)

Maybe it's another case then, your version is new.
Now I see 'd:appendix' appeared in
https://github.com/docbook/xslt10-stylesheets/blob/master/xsl/html/chunktoc.xsl


   Perhaps that
business about conditional use of UnwrapLinks and other things like it
change the numbers.  It's interesting that "gentext.template" is in
the same ballpark on our two systems in terms of calls and CPU time,
but the top templates are massive outliers on my system.  I have no
idea what I'm even looking at really but I couldn't help noticing that
templates with match="chapter" and match="appendix" appear in our tree
in sgml/stylesheet-speedup-common.xsl with a comment
"Performance-optimized versions of some upstream templates from
common/ directory".  Could it be that whatever performance-enhancing
trick they perform doesn't work on 1.1.32, or alternatively they are
not being reached so we're falling back to non-optimised versions
instead of these?


I wonder, what version of docbook-xsl are you using?
(I have 1.79.1+dfsg-1).
Can you check with 1.79+ (if yours is older)?

docbook-xsl version 1.79.2_1.

I'll try to install 1.79.2 version and check the performance on my side.

--
Alexander Lakhin
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


Re: MacPorts xsltproc is very slow?

2017-11-25 Thread Alexander Lakhin

25.11.2017 11:21, Alexander Lakhin wrote:

I wonder, what version of docbook-xsl are you using?

(I have 1.79.1+dfsg-1).
Can you check with 1.79+ (if yours is older)?

docbook-xsl version 1.79.2_1.

I'll try to install 1.79.2 version and check the performance on my side.
I installed docbook-style-xsl-1.79.2-5 in Fedora 27 and didn't noticed 
performance drop.
In fact in this version I see XSL templates without namespaces 
("appendix" instead of "d:appendix").

I looked at the spec of the package and found that it's building from the
"https://github.com/docbook/xslt10-stylesheets/releases/download/release%2F{%version}/docbook-xsl-nons-%{version}.tar.bz2";
nons - is for "no namespace"

Indeed, you can see both variations of the source packages at:
https://github.com/docbook/xslt10-stylesheets/releases/tag/release%2F1.79.2

It seems that your package is built from "ns" version.
(I couldn't find docbook-xsl-nons in Macports.)
If it's the only available version for Mac, it seems we need to adjust 
our XSL templates to work with namespaces too.


Best regards,
--
Alexander Lakhin
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company



Re: [DOCS] Docbook 5.x

2017-11-28 Thread Alexander Lakhin

Hello Peter,
28.11.2017 19:02, Peter Eisentraut wrote:


What is the standalonetext attribute?  I don't see that in the DTD.
Wouldn't that fail validation?

I've added it to postgres.sgml as allowed by DocBook standard:
http://www.sagehill.net/docbookxsl/AddProfileAtt.html
+


Also, the makefile fragments need to be written differently.  You can't
use pipes; that would not catch any errors.


I believe, that the last xsltproc will fail in case of error in previous 
command(s) as it will not get valid xml. For example, if sed failed with 
error, I get:

-:1: parser error : Document is empty


Best regards,
------
Alexander Lakhin
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company




Re: [DOCS] list of credits for release notes

2018-02-02 Thread Alexander Lakhin

Hello,
03.02.2018 00:56, Peter Eisentraut wrote:

On 10/3/17 03:16, Alexander Lakhin wrote:

While working on translation I've found a wrong name in credits:
Fakhroutdinov Evgenievich

That's how the name was entered in bug #14682.


I understand it, and I found his real name by the email mentioned in the 
bug. So he just specified his name erroneously in the e-mail client.
Should we preserve the error? (In fact I fixed the name in Russian 
translation because It looks ridiculous for Russians (as "Belmondo 
Paul(-son)" instead of "Jean-Paul Belmondo")).


Best regards,
Alexander




Re: PDF build warnings

2018-06-26 Thread Alexander Lakhin
Hello,
27.06.2018 02:10, Tom Lane wrote:
> Alvaro Herrera  writes:
>> When doing a test run of the PDF docs for beta2 on borka, I noticed that the
>> build finishes with this -- is it expected?
>> [ lots of "Unresolved ID reference" ]
> Yeah, we've pretty much always had that.  It used to be spelled
> differently with the old toolchain, but I think mostly the same
> tags were complained of.  Don't know the cause.
This was discussed some time ago:
https://www.postgresql.org/message-id/45f75674-221b-1ec4-69ca-f9c00bd4b...@2ndquadrant.com

As I remember such id don't get into internal FOP id table and then when
rechecking id's it can't be resolved.
Still think that it should be fixed just to bring attention to another
(may be more important) warnings.
I can prepare a patch if you find it useful.

Best regards,
--
Alexander Lakhin
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


A typo in release notes

2018-11-12 Thread Alexander Lakhin
Hello,

I believe, that the name "Masahiko Sawada" was misspelled in the latest
release notes.
See:
https://www.postgresql.org/message-id/CAD21AoB5K1qJm%2Bwj%2BTTCP-sFPiSdnd0LGd_pNAfi3VXrGKfdjw%40mail.gmail.com
The patch is attached.

Best regards,
Alexander
diff --git a/doc/src/sgml/release-10.sgml b/doc/src/sgml/release-10.sgml
index 0c02ecbc4e..de7779f622 100644
--- a/doc/src/sgml/release-10.sgml
+++ b/doc/src/sgml/release-10.sgml
@@ -508,7 +508,7 @@ Branch: REL9_5_STABLE [69a568636] 2018-09-26 10:30:38 +0900
 -->
  
   Fix handling of commit-timestamp tracking during recovery
-  (Masahiko Sawasa, Michael Paquier)
+  (Masahiko Sawada, Michael Paquier)
  
 
  
diff --git a/doc/src/sgml/release-9.5.sgml b/doc/src/sgml/release-9.5.sgml
index 1324bc09f9..ccd8eee3e3 100644
--- a/doc/src/sgml/release-9.5.sgml
+++ b/doc/src/sgml/release-9.5.sgml
@@ -239,7 +239,7 @@
 
  
   Fix handling of commit-timestamp tracking during recovery
-  (Masahiko Sawasa, Michael Paquier)
+  (Masahiko Sawada, Michael Paquier)
  
 
  
diff --git a/doc/src/sgml/release-9.6.sgml b/doc/src/sgml/release-9.6.sgml
index 2ad4e8ea86..acebcc6249 100644
--- a/doc/src/sgml/release-9.6.sgml
+++ b/doc/src/sgml/release-9.6.sgml
@@ -261,7 +261,7 @@
 
  
   Fix handling of commit-timestamp tracking during recovery
-  (Masahiko Sawasa, Michael Paquier)
+  (Masahiko Sawada, Michael Paquier)
  
 
  


Some typos in documentation

2019-01-12 Thread Alexander Lakhin
Hello,
While cross-checking the unique words in doc/ I found a few typos.

REL9_6_STABLE
transcations
(Also there are two 'transcation's in src/bin/psql/po/tr.po, probably
these are typos too.)

REL_10_STABLE+
PQencryptPasswodConn

pg_current_logfiles -- there is only the "pg_current_logfile" function.

NOCONNECT -- this option was replaced with "connect = false" by commit
b807f5982.

LockFileCreateWrite -- Should be spelled as LockFileCreateWRITE (as in
pgstat.c) or LockFileCreateWRITE in pg.stat.s should use CamelCase in
whole. I don't find any dependencies so I would prefer the latter.

REL_11_STABLE+
pg_execute_server_programs -- I could find only the
pg_execute_server_program role in pg_authid.dat.

All the corresponding patches are attached.

Best regards,
Alexander


diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml
index da3a900dc1..5f3adc98c9 100644
--- a/doc/src/sgml/maintenance.sgml
+++ b/doc/src/sgml/maintenance.sgml
@@ -594,7 +594,7 @@ SELECT datname, age(datfrozenxid) FROM pg_database;
 scans every page in the table that is not already all-frozen, it should
 set age(relfrozenxid) to a value just a little more than the
 vacuum_freeze_min_age setting
-that was used (more by the number of transcations started since the
+that was used (more by the number of transactions started since the
 VACUUM started).  If no relfrozenxid-advancing
 VACUUM is issued on the table until
 autovacuum_freeze_max_age is reached, an autovacuum will soon

diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index e8ec495d03..ad2e3a4466 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -6106,7 +6106,7 @@ char *PQencryptPasswordConn(PGconn *conn, const char *passwd, const char *user,
 char *PQencryptPassword(const char *passwd, const char *user);
 
   PQencryptPassword is an older, deprecated version of
-  PQencryptPasswodConn. The difference is that
+  PQencryptPasswordConn. The difference is that
   PQencryptPassword does not
   require a connection object, and md5 is always used as the
   encryption algorithm.

diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 0915be0d6d..8fd1288dca 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -16153,7 +16153,7 @@ SET search_path TO schema , schema, ..
 optional parameter. The return value is NULL when the
 log format requested is not a configured
 .  The
-pg_current_logfiles reflects the contents of the
+pg_current_logfile reflects the contents of the
 current_logfiles file.

 

diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
index 4c63ebb7b0..c221d2a080 100644
--- a/doc/src/sgml/ref/pg_dump.sgml
+++ b/doc/src/sgml/ref/pg_dump.sgml
@@ -1246,7 +1246,7 @@ CREATE DATABASE foo WITH TEMPLATE template0;
   
When dumping logical replication subscriptions,
pg_dump will generate CREATE
-   SUBSCRIPTION commands that use the NOCONNECT
+   SUBSCRIPTION commands that use the connect = false
option, so that restoring the subscription does not make remote connections
for creating a replication slot or for initial table copy.  That way, the
dump can be restored without requiring network access to the remote

diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index 302c331c49..ac658dcb24 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -3745,7 +3745,7 @@ pgstat_get_wait_io(WaitEventIO w)
 			event_name = "LockFileCreateSync";
 			break;
 		case WAIT_EVENT_LOCK_FILE_CREATE_WRITE:
-			event_name = "LockFileCreateWRITE";
+			event_name = "LockFileCreateWrite";
 			break;
 		case WAIT_EVENT_LOCK_FILE_RECHECKDATADIR_READ:
 			event_name = "LockFileReCheckDataDirRead";

diff --git a/doc/src/sgml/file-fdw.sgml b/doc/src/sgml/file-fdw.sgml
index 955a13ab7d..d80142b4fd 100644
--- a/doc/src/sgml/file-fdw.sgml
+++ b/doc/src/sgml/file-fdw.sgml
@@ -188,7 +188,7 @@
  
   Changing table-level options requires being a superuser or having the privileges
   of the default role pg_read_server_files (to use a filename) or
-  the default role pg_execute_server_programs (to use a program),
+  the default role pg_execute_server_program (to use a program),
   for security reasons: only certain users should be able to control which file is
   read or which program is run.  In principle regular users could be allowed to
   change the other options, but that's not supported at present.



Fix contributor name-related inconsistencies in release-12.sgml

2019-09-23 Thread Alexander Lakhin
Hello,

While translating Release Notes for version 12 I found some
inconsistencies with contributor names.
1. Constantine Kuznetsov and Konstantin Kuznetsov are the same person.
2. Sho Kato and Kato Sho too.
3. Takayuki Tsunakawa is present in the Acknowledgments, but Tsunakawa
Takayuki is referred in the change list.
Regarding Japanese names I found that in the Postgres documentation the
given name is mostly specified first. E.g.: Daisuke Higuchi, Haruka
Takatsuka, Hayato Kuroda, Hironobu Suzuki, Keiichi Hirobe, Kenji Uno,...
So I would remove "Kato Sho" because "Sho" is a given name:
https://en.wikipedia.org/wiki/Sh%C5%8D_(given_name)
And change "Tsunakawa Takayuki" to "Takayuki Tsunakawa" because
"Takayuki" is a given name: https://en.wikipedia.org/wiki/Takayuki

Also, there are other names spelled in the reverse order:
Fujii Masao
Koizumi Satoru
Matsumura Ryo
So I propose a second patch to fix these names too.

Best regards,
Alexander
diff --git a/doc/src/sgml/release-12.sgml b/doc/src/sgml/release-12.sgml
index 129787b4c9..dddc7c985c 100644
--- a/doc/src/sgml/release-12.sgml
+++ b/doc/src/sgml/release-12.sgml
@@ -1939,7 +1939,7 @@ Author: Michael Paquier 
   
Allow the streaming replication timeout () to be set per connection
-   (Tsunakawa Takayuki)
+   (Takayuki Tsunakawa)
   
 
   
@@ -2140,7 +2140,7 @@ Author: Fujii Masao 
   
Add  and CREATE
TABLE options to prevent VACUUM
-   from truncating trailing empty pages (Tsunakawa Takayuki)
+   from truncating trailing empty pages (Takayuki Tsunakawa)
   
 
   
@@ -3575,7 +3575,6 @@ Author: Michael Paquier 
 Christoph Moench-Tegeder
 Clemens Ladisch
 Colm McHugh
-Constantine Kuznetsov
 Corey Huinker
 Craig Ringer
 Dagfinn Ilmari Mannsåker
@@ -3851,7 +3850,6 @@ Author: Michael Paquier 
 Sergio Conde Gómez
 Shawn Debnath
 Shay Rojansky
-Sho Kato
 Shohei Mochizuki
 Shouyu Luo
 Simon Riggs
diff --git a/doc/src/sgml/release-12.sgml b/doc/src/sgml/release-12.sgml
index dddc7c985c..e57154b387 100644
--- a/doc/src/sgml/release-12.sgml
+++ b/doc/src/sgml/release-12.sgml
@@ -254,7 +254,7 @@ Author: Peter Eisentraut 
  
   Move recovery.conf settings into postgresql.conf
-  (Fujii Masao, Simon Riggs, Abhijit Menon-Sen, Sergei Kornilov)
+  (Masao Fujii, Simon Riggs, Abhijit Menon-Sen, Sergei Kornilov)
  
 
  
@@ -2675,7 +2675,7 @@ Author: Michael Meskes 
 
   
Allow  to create variables of data type
-   bytea (Matsumura Ryo)
+   bytea (Ryo Matsumura)
   
 
   
@@ -2692,7 +2692,7 @@ Author: Michael Meskes 
 
   
Add PREPARE AS support to
-   ECPG (Matsumura Ryo)
+   ECPG (Ryo Matsumura)
   
  
 
@@ -3621,7 +3621,6 @@ Author: Michael Paquier 
 Fabrízio de Royes Mello
 Feike Steenbergen
 Filip Rembialkowski
-Fujii Masao
 Gaby Schilders
 Geert Lobbestael
 George Tarasov
@@ -3711,7 +3710,6 @@ Author: Michael Paquier 
 Kevin Hale Boyes
 Kieran McCusker
 Kirk Jamison
-Koizumi Satoru
 Konstantin Knizhnik
 Konstantin Kuznetsov
 Kristjan Tammekivi
@@ -3748,9 +3746,9 @@ Author: Michael Paquier 
 Markus Winand
 Martín Marqués
 Masahiko Sawada
+Masao Fujii
 Mateusz Guzik
 Mathias Brossard
-Matsumura Ryo
 Matt Williams
 Matthias Otterbach
 Matvey Arye
@@ -3838,11 +3836,13 @@ Author: Michael Paquier 
 Rui Hai Jiang
 Rushabh Lathia
 Ryan Lambert
+Ryo Matsumura
 Ryohei Nagaura
 Ryohei Takahashi
 Samuel Williams
 Sand Stone
 Sanyo Capobiango
+Satoru Koizumi
 Sean Johnston
 Serge Latyntsev
 Sergei Kornilov


Miscellaneous minor fixes

2019-10-14 Thread Alexander Lakhin
Hello,

Please consider fixing minor inconsistencies and typos in doc/.
(fix-contributor-name.patch is for REL_12_STABLE only)

Best regards,
Alexander
diff --git a/doc/src/sgml/ref/copy.sgml b/doc/src/sgml/ref/copy.sgml
index 5e2992ddac..3e6f9cd532 100644
--- a/doc/src/sgml/ref/copy.sgml
+++ b/doc/src/sgml/ref/copy.sgml
@@ -1015,22 +1015,22 @@ COPY table_name [ ( filename' | STDIN }
 [ [ WITH ]
   [ BINARY ]
-  [ DELIMITER [ AS ] 'delimiter' ]
-  [ NULL [ AS ] 'null string' ]
+  [ DELIMITER [ AS ] 'delimiter_character' ]
+  [ NULL [ AS ] 'null_string' ]
   [ CSV [ HEADER ]
-[ QUOTE [ AS ] 'quote' ]
-[ ESCAPE [ AS ] 'escape' ]
+[ QUOTE [ AS ] 'quote_character' ]
+[ ESCAPE [ AS ] 'escape_character' ]
 [ FORCE NOT NULL column_name [, ...] ] ] ]
 
 COPY { table_name [ ( column_name [, ...] ) ] | ( query ) }
 TO { 'filename' | STDOUT }
 [ [ WITH ]
   [ BINARY ]
-  [ DELIMITER [ AS ] 'delimiter' ]
-  [ NULL [ AS ] 'null string' ]
+  [ DELIMITER [ AS ] 'delimiter_character' ]
+  [ NULL [ AS ] 'null_string' ]
   [ CSV [ HEADER ]
-[ QUOTE [ AS ] 'quote' ]
-[ ESCAPE [ AS ] 'escape' ]
+[ QUOTE [ AS ] 'quote_character' ]
+[ ESCAPE [ AS ] 'escape_character' ]
 [ FORCE QUOTE { column_name [, ...] | * } ] ] ]
 
 
@@ -1046,13 +1046,13 @@ COPY { table_name [ ( 
 COPY [ BINARY ] table_name
 FROM { 'filename' | STDIN }
-[ [USING] DELIMITERS 'delimiter' ]
-[ WITH NULL AS 'null string' ]
+[ [USING] DELIMITERS 'delimiter_character' ]
+[ WITH NULL AS 'null_string' ]
 
 COPY [ BINARY ] table_name
 TO { 'filename' | STDOUT }
-[ [USING] DELIMITERS 'delimiter' ]
-[ WITH NULL AS 'null string' ]
+[ [USING] DELIMITERS 'delimiter_character' ]
+[ WITH NULL AS 'null_string' ]
 
  
 
diff --git a/doc/src/sgml/extend.sgml b/doc/src/sgml/extend.sgml
index 8dc2b893f7..a3046f22d0 100644
--- a/doc/src/sgml/extend.sgml
+++ b/doc/src/sgml/extend.sgml
@@ -856,7 +856,7 @@ SELECT pg_catalog.pg_extension_config_dump('my_config', 'WHERE NOT standard_entr
  dynamically from one version to the next, you should provide
  update scripts that make the necessary changes to go from
  one version to the next.  Update scripts have names following the pattern
- extension--oldversion--newversion.sql
+ extension--old_version--target_version.sql
  (for example, foo--1.0--1.1.sql contains the commands to modify
  version 1.0 of extension foo into version
  1.1).
diff --git a/doc/src/sgml/release-12.sgml b/doc/src/sgml/release-12.sgml
index 04f4effa8a..126d6144a4 100644
--- a/doc/src/sgml/release-12.sgml
+++ b/doc/src/sgml/release-12.sgml
@@ -3917,7 +3917,7 @@ Author: Michael Paquier 
 Yuming Wang
 YunQiang Su
 Yuri Kurenkov
-Yusuke Egashita
+Yusuke Egashira
 Yuzuko Hosoya
 Zhou Digoal

diff --git a/doc/src/sgml/ref/prepare.sgml b/doc/src/sgml/ref/prepare.sgml
index 9f786cd3ad..4e5e96a401 100644
--- a/doc/src/sgml/ref/prepare.sgml
+++ b/doc/src/sgml/ref/prepare.sgml
@@ -165,7 +165,7 @@ PREPARE name [ ( PostgreSQL is using
for a prepared statement, use , for example
 
-EXPLAIN EXECUTE stmt_name(parameter_values);
+EXPLAIN EXECUTE name(parameter_values);
 
If a generic plan is in use, it will contain parameter symbols
$n, while a custom plan
diff --git a/doc/src/sgml/ref/set_role.sgml b/doc/src/sgml/ref/set_role.sgml
index 9ab0d6af04..a4842f363c 100644
--- a/doc/src/sgml/ref/set_role.sgml
+++ b/doc/src/sgml/ref/set_role.sgml
@@ -64,7 +64,7 @@ RESET ROLE
 
   
Using this command, it is possible to either add privileges or restrict
-   one's privileges.  If the session user role has the INHERITS
+   one's privileges.  If the session user role has the INHERIT
attribute, then it automatically has all the privileges of every role that
it could SET ROLE to; in this case SET ROLE
effectively drops all the privileges assigned directly to the session user


Re: Getting our tables to render better in PDF output

2020-02-11 Thread Alexander Lakhin
Hello Tom,
12.02.2020 00:51, Tom Lane wrote:
> The crummy formatting of our tables of functions and operators has
> been an issue for a long time.  To my mind, there are several things
> that need to be addressed:
>
> * The layout is completely unfriendly to function descriptions that
> run to more than a few words.
>
> * It's not very practical to have more than one example per function
> (or at least, we seldom do so).
>
> * The results look completely awful in PDF format, because of the
> narrow effectively-available space, plus the fact that the toolchain
> will prefer to overprint following columns instead of breaking text
> where there's no whitespace.
Please look at a less invasive approach that we use at Postgres Pro for
some time (mainly for improving the translated documentation, but it
works for the original one too). The idea is to add zero-width spaces
after/before some chars ('(', ',', '[', etc) to let fop split lines
where desired. It has one disadvantage - it's not search-friendly
(though maybe that is application-dependent).
But if it's feasible, I think this approach can at least complement a
manual tables reformatting. Decreasing a font size in the tables seems
appropriate to me too.

Best regards,
Alexander
diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile
index 0401a515df8..3be29dba9f1 100644
--- a/doc/src/sgml/Makefile
+++ b/doc/src/sgml/Makefile
@@ -169,10 +169,14 @@ XSLTPROC_FO_FLAGS += --stringparam img.src.path '$(srcdir)/'
 %-A4.fo: stylesheet-fo.xsl %.sgml $(ALLSGML)
 	$(XMLLINT) $(XMLINCLUDE) --noout --valid $(word 2,$^)
 	$(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_FO_FLAGS) --stringparam paper.type A4 -o $@ $(wordlist 1,2,$^)
+	$(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) -o $@.tmp $(@D)/pg-customize-fo.xsl $@
+	mv $@.tmp $@
 
 %-US.fo: stylesheet-fo.xsl %.sgml $(ALLSGML)
 	$(XMLLINT) $(XMLINCLUDE) --noout --valid $(word 2,$^)
 	$(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_FO_FLAGS) --stringparam paper.type USletter -o $@ $(wordlist 1,2,$^)
+	$(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) -o $@.tmp $(@D)/pg-customize-fo.xsl $@
+	mv $@.tmp $@
 
 %.pdf: %.fo $(ALL_IMAGES)
 	$(FOP) -fo $< -pdf $@
diff --git a/doc/src/sgml/pg-customize-fo.xsl b/doc/src/sgml/pg-customize-fo.xsl
new file mode 100644
index 000..48978880126
--- /dev/null
+++ b/doc/src/sgml/pg-customize-fo.xsl
@@ -0,0 +1,118 @@
+
+http://www.w3.org/1999/XSL/Format"; version="1.0"
+xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
+
+  
+
+  
+
+  
+
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
+
+  
+  
+
+  
+
+  
+
+  
+
+
+
+
+  
+
+
+
+  
+  
+  
+
+  
+  
+
+  
+
+  
+
+  
+
+  
+
+  
+  
+
+  
+
+  
+
+  
+
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
+
+


Re: Getting our tables to render better in PDF output

2020-02-12 Thread Alexander Lakhin
12.02.2020 23:58, Tom Lane wrote:
> Alexander Lakhin  writes:
>> Please look at a less invasive approach that we use at Postgres Pro for
>> some time (mainly for improving the translated documentation, but it
>> works for the original one too). The idea is to add zero-width spaces
>> after/before some chars ('(', ',', '[', etc) to let fop split lines
>> where desired. It has one disadvantage - it's not search-friendly
>> (though maybe that is application-dependent).
>> But if it's feasible, I think this approach can at least complement a
>> manual tables reformatting. Decreasing a font size in the tables seems
>> appropriate to me too.
> Hmm, interesting proposal.  I experimented and verified that injecting
> zero-width space (​) does allow line breaking to occur in both
> HTML and PDF output, so this could be a route to improving the situation
> for overlength example texts.  I do not think I like the idea of
> automatically injecting tons of them, though.  As you say, it might
> hinder searching; and it would allow some silly breaks; and there are
> cases where it still wouldn't find a break, such as the examples for
> sha256() et al.  I'd be happier about manually inserting breaks just
> in the places we really need them.  To keep the source readable, I'd
> want to write something like "&zwsp;" not a numeric entity code,
> but it looks like we can define custom entities if we want.
Yes, I was starting with manual &zwsp; insertions into the translation,
but later I reduced such insertions just to several dozens. (For
example, we still have "3.1415926535&zwsp;8979323846" in the translation.)
The main issue of the manual approach was that I needed to recheck that
zwsp placement on updates, and I can't see where it's desired until I
generate pdf. Fortunately, fop prints warning like that:
[WARN] FOUserAgent - The contents of fo:block line 2 exceed the
available area in the inline-progression direction by 22725 millipoints.
(See position 127769:983)
It's not very user-friendly, but still useful when we have a pair or two
of them. (For now, I see 559 such warnings in REL_12_STABLE.)
Second issue is that the placement can depend on the page size and in
fact most of that zwsps are not needed for html or other formats
(moreover, some formats can require different placements (if we're not
just implementing some common rules)).
Third (minor) issue is with translation - when I will see some break in
the English source, e.g. "split_part('abc~@~def&zwsp;~@~ghi', '~@~',
2)", should I leave the break in the same place, or it's better to move
it because adjacent text has different length and the table columns have
different width?

For me this approach expresses a belief that the line breaking rules
should be slightly different in our context. For example, having line
break after an opening bracket is feasible and common in function calls
and declarations. Maybe the rules in the proposed xslt could be
improved/restricted, but I think that if fop would allow us to enable an
imaginary 'programming language line breaking rules' mode, we would use
it for our tables (some or all).
Maybe some of the rules can be implemented explicitly in the DocBook
source, just to reduce tons of zwsp in the generated output, or the
"fo:table-cell/fo:block//text()" condition can be improved to filter
some (text-only?) tables out, but I think that the idea of our specific
line breaking rules could work.

Best regards,
Alexander




Re: Getting our tables to render better in PDF output

2020-02-14 Thread Alexander Lakhin
Hello Alvaro,
14.02.2020 23:16, Alvaro Herrera wrote:
> On 2020-Feb-13, Alexander Lakhin wrote:
>
>> Yes, I was starting with manual &zwsp; insertions into the translation,
>> but later I reduced such insertions just to several dozens. (For
>> example, we still have "3.1415926535&zwsp;8979323846" in the translation.)
>> The main issue of the manual approach was that I needed to recheck that
>> zwsp placement on updates, and I can't see where it's desired until I
>> generate pdf. Fortunately, fop prints warning like that:
>> [WARN] FOUserAgent - The contents of fo:block line 2 exceed the
>> available area in the inline-progression direction by 22725 millipoints.
>> (See position 127769:983)
>> It's not very user-friendly, but still useful when we have a pair or two
>> of them.
> It seems to me that a productive way forward would be to fix the layout
> to make these warning disappear. Then it will be relatively easy to find
> where to fix, if new ones appear.
>
> Now I suppose you're complaining about the "position 127769:983" part of
> the error message which tells you with zero clarity where the problem
> is.  Maybe what we need is to figure out what the numbers mean, and how
> to use them; for example if they are byte offsets into the file, then it
> should be possible to tell your editor to go to that byte in the
> complete XML file.
I'm not complaining about the cryptic position of the problems, I'm
concerned with their number.
The position is specified as {line_number}:{character_postition} in
postgres-*.fo (not in the DocBook source).
For example, when performing `make postgres-A4.pdf` on REL_12_STABLE I get:
[WARN] FOUserAgent - The contents of fo:block line 1 exceed the
available area in the inline-progression direction by more than 50
points. (See position 28808:374)

To find an exact problematic text you can look at the specified line(s)
of postgres-A4.fo:
/$ sed -n '28808,28811p' postgres-A4.fo /

EXPLAIN SELECT * FROM tenk1 WHERE unique1 < 100;

Searching this text in pdf gets you to page 467 where you can see a long
line of '---' going of the page...
>> Third (minor) issue is with translation - when I will see some break in
>> the English source, e.g. "split_part('abc~@~def&zwsp;~@~ghi', '~@~',
>> 2)", should I leave the break in the same place, or it's better to move
>> it because adjacent text has different length and the table columns have
>> different width?
> If the English version is warning-clean, then it should be possible to
> keep the zwsps in the same location in the translation, and then tweak
> the translation according to any new warnings that appear there.
> My guess is that the majority of zwsps are going to want to stay in the
> same place.
Yes, that's why I consider this as minor issue, but some kind of an
automatic solution can eliminate it at all.
>> Maybe some of the rules can be implemented explicitly in the DocBook
>> source, just to reduce tons of zwsp in the generated output, or the
>> "fo:table-cell/fo:block//text()" condition can be improved to filter
>> some (text-only?) tables out, but I think that the idea of our specific
>> line breaking rules could work.
> Maybe we can mark-up specific table cells/columns as being subject to
> the special line breaking rules.
Things made complicated by the xslt preprocessor, because you can't see
Docbook tags and attributes on a FOP level, but I can explore possible
resolutions if we choose to go this way.

Best regards,
Alexander


Re: PDF doc build is broken on recent Fedora

2020-02-15 Thread Alexander Lakhin
Hello Tom,
13.02.2020 23:37, Tom Lane wrote:
> By chance I tried to build our PDF docs on a Fedora 30
> installation, and it doesn't work.  xsltproc seems to
> get hung up in a tight loop before it starts to produce
> any output.  The HTML build works fine, though.
>
> Relevant package versions:
>
> docbook-style-xsl-1.79.2-9.fc30.noarch
> libxslt-1.1.33-1.fc30.x86_64
>
> Anybody seen this, or have an idea what to poke at?
I've just reproduced this on Fedora 29, 30, 31.
On Fedora 29 I see almost the same package versions:
docbook-style-xsl-1.79.2-8.fc29.noarch
libxslt-1.1.33-1.fc29.x86_64

But it's not reproduced on Fedora 28, where I have:
docbook-style-xsl-1.79.2-7.fc28.noarch
libxslt-1.1.32-2.fc28.x86_64

I will explore this further...

Best regards,
Alexander




Re: PDF doc build is broken on recent Fedora

2020-02-15 Thread Alexander Lakhin
15.02.2020 12:09, Alexander Lakhin wrote:
> I've just reproduced this on Fedora 29, 30, 31.
> On Fedora 29 I see almost the same package versions:
> docbook-style-xsl-1.79.2-8.fc29.noarch
> libxslt-1.1.33-1.fc29.x86_64
>
> But it's not reproduced on Fedora 28, where I have:
> docbook-style-xsl-1.79.2-7.fc28.noarch
> libxslt-1.1.32-2.fc28.x86_64
>
> I will explore this further...
It seems Peter was here first:
https://gitlab.gnome.org/GNOME/libxslt/issues/16

Best regards,
Alexander




Re: Getting our tables to render better in PDF output

2020-02-16 Thread Alexander Lakhin
Hello Tom,
> 16.02.2020 23:07, Tom Lane wrote:
>
>
> I poked at this a little bit, and found that I could get a pretty
> decent-looking result if I hacked the .fo file to contain
> "→" rather than a bare
> right arrow.  (See attached screenshot, wherein the last rightarrow
> was fixed this way but the others weren't.)  However, I do not
> have much of a clue as to how such a fix might be injected into
> our stylesheets --- anybody have a suggestion?
Please look at the XSLT template for processing .fo before calling fop.
Maybe this can be done with just the existing stylesheet-fo.xsl, I'll
try to research this later.

Best regards,
Alexander

diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile
index 0401a515df8..3be29dba9f1 100644
--- a/doc/src/sgml/Makefile
+++ b/doc/src/sgml/Makefile
@@ -169,10 +169,14 @@ XSLTPROC_FO_FLAGS += --stringparam img.src.path '$(srcdir)/'
 %-A4.fo: stylesheet-fo.xsl %.sgml $(ALLSGML)
 	$(XMLLINT) $(XMLINCLUDE) --noout --valid $(word 2,$^)
 	$(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_FO_FLAGS) --stringparam paper.type A4 -o $@ $(wordlist 1,2,$^)
+	$(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) -o $@.tmp $(@D)/pg-customize-fo.xsl $@
+	mv $@.tmp $@
 
 %-US.fo: stylesheet-fo.xsl %.sgml $(ALLSGML)
 	$(XMLLINT) $(XMLINCLUDE) --noout --valid $(word 2,$^)
 	$(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_FO_FLAGS) --stringparam paper.type USletter -o $@ $(wordlist 1,2,$^)
+	$(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) -o $@.tmp $(@D)/pg-customize-fo.xsl $@
+	mv $@.tmp $@
 
 %.pdf: %.fo $(ALL_IMAGES)
 	$(FOP) -fo $< -pdf $@
diff --git a/doc/src/sgml/pg-customize-fo.xsl b/doc/src/sgml/pg-customize-fo.xsl
new file mode 100644
index 000..ba3138e2a3d
--- /dev/null
+++ b/doc/src/sgml/pg-customize-fo.xsl
@@ -0,0 +1,42 @@
+
+http://www.w3.org/1999/XSL/Format"; version="1.0"
+xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
+
+  
+
+  
+
+  
+
+  
+
+  
+
+  
+
+  
+  
+
+  
+
+  
+
+  
+
+
+  
+
+  
+
+→
+
+  
+
+  
+  
+
+  
+
+  
+
+


Re: Getting our tables to render better in PDF output

2020-02-18 Thread Alexander Lakhin
17.02.2020 00:21, Alexander Lakhin wrote:
> Hello Tom,
>> 16.02.2020 23:07, Tom Lane wrote:
>>
>>
>> I poked at this a little bit, and found that I could get a pretty
>> decent-looking result if I hacked the .fo file to contain
>> "→" rather than a bare
>> right arrow.  (See attached screenshot, wherein the last rightarrow
>> was fixed this way but the others weren't.)  However, I do not
>> have much of a clue as to how such a fix might be injected into
>> our stylesheets --- anybody have a suggestion?
> Please look at the XSLT template for processing .fo before calling fop.
> Maybe this can be done with just the existing stylesheet-fo.xsl, I'll
> try to research this later.
I've managed to simplify the patch a little by incorporating those
templates in stylesheet-fo.xsl.

Maybe it's better to use the same formatting as in the docbook xsl
template (see docbook/stylesheet/docbook-xsl/xhtml-1_1/inline.xsl).
There "$menuchoice.menu.separator" is enclosed in ...
and you can see the effect on page 536 (IPC parameters can be set in the
System Administration Manager (SAM) under Kernel Configu-
ration → Configurable Parameters.)

Yet another possibility is to use the docbook tags:
func()
int.
Then we can define the desired formatting for such markup (similar to
..).

Best regards,
Alexander
diff --git a/doc/src/sgml/stylesheet-fo.xsl b/doc/src/sgml/stylesheet-fo.xsl
index ea754084be0..7b843e7037f 100644
--- a/doc/src/sgml/stylesheet-fo.xsl
+++ b/doc/src/sgml/stylesheet-fo.xsl
@@ -94,4 +94,35 @@
   
 
 
+
+  
+
+  
+
+  
+
+
+  
+
+  
+
+
+
+  
+  
+
+  
+
+  
+  →
+  
+
+  
+
+
+  
+
+  
+
+
 


Re: Getting our tables to render better in PDF output

2020-04-12 Thread Alexander Lakhin
Hello Tom,
12.04.2020 20:33, Tom Lane wrote:
> I wrote:
>> So if we can get  to both insert a right arrow and switch the
>> font to match 's choice, this would work more or less decently, and
>> it's probably cleaner than the bare-entity-reference approach I posted
>> before.  I don't have the XSL skills to get that to work though.
>> Anyone want to help out?
> I educated myself a teensy bit about XSL, and unless I'm missing
> something, this is really pretty darn trivial; the attached seems
> to do the trick.
I've come to almost the same solution simultaneously. I think this
should work for us.

Best regards,
Alexander





Re: Rendering pi more nicely in PDF

2020-04-26 Thread Alexander Lakhin
>From the symbolic unit of the department...

Hello Tom,
26.04.2020 22:13, Tom Lane wrote:
> In the department of nitpickery ...
>
> "π" renders poorly in our PDF docs: as shown in the attached
> screenshot, it doesn't line up on the baseline.  I realized that
> this is the same problem I'd run into recently with right-arrow,
> and it can be solved in the same way, namely we have to specify
> use of the symbol font explicitly.  So attached is a proposed
> patch to fix it.
>
> Use of a new processing-instruction might not be the most elegant
> way to do this ... anyone have a better suggestion?
I would use the phrase tag, which is intended for such uses: [1] [2].
The "phrase" sounds too generic, but it doesn't require yet another
processing instruction e.g. for ∑ or a similar entity.

[1] http://www.sagehill.net/docbookxsl/CustomInlines.html
[2] https://tdg.docbook.org/tdg/4.5/phrase.html

Best regards,
Alexander
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index b0afaebf728..16a4a679d1c 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -1365,7 +1365,7 @@ repeat('Pg', 4) PgPgPgPg
 pi (  )
 double precision

-Approximate value of π
+Approximate value of π

 pi()
 3.141592653589793
diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml
index 58a2aa3bf20..8c5bf18f79c 100644
--- a/doc/src/sgml/ref/pgbench.sgml
+++ b/doc/src/sgml/ref/pgbench.sgml
@@ -1528,7 +1528,7 @@ SELECT 4 AS four \; SELECT 5 AS five \aset
   
pi()
double
-   value of the constant PI
+   value of the constant π
pi()
3.14159265358979323846
   
diff --git a/doc/src/sgml/stylesheet-fo.xsl b/doc/src/sgml/stylesheet-fo.xsl
index 6797e06a77c..3d3ab02ae9a 100644
--- a/doc/src/sgml/stylesheet-fo.xsl
+++ b/doc/src/sgml/stylesheet-fo.xsl
@@ -132,4 +132,8 @@
   
 
 
+
+  
+
+
 


Re: Rendering pi more nicely in PDF

2020-04-27 Thread Alexander Lakhin
27.04.2020 18:04, Tom Lane wrote:
> Alexander Lakhin  writes:
>> 26.04.2020 22:13, Tom Lane wrote:
>> BTW, I tried to also use this  markup inside the template for
>> , so we'd only need one font-switching special case not two.
>> Didn't work though --- apparently templates don't get applied recursively?
>> Oh well.
We can have a single template "symbol_font" and reuse it, but it doesn't
seem cleaner to me (for just two cases).
(Placing   into  wouldn't
work as such a content goes into the output, whilst all xsl:templates
apply to the input tree.)

Best regards,
Alexander
diff --git a/doc/src/sgml/stylesheet-fo.xsl b/doc/src/sgml/stylesheet-fo.xsl
index 2f2517d8ce..38c96737d5 100644
--- a/doc/src/sgml/stylesheet-fo.xsl
+++ b/doc/src/sgml/stylesheet-fo.xsl
@@ -92,7 +92,7 @@
 
 
 
-  → 
+  
   
 
 
@@ -102,8 +102,9 @@
 
 
 
-
-  
+
+  
+  
 
 
 


Re: Rendering pi more nicely in PDF

2020-04-29 Thread Alexander Lakhin
Hello hackers,

30.04.2020 00:23, Alvaro Herrera wrote:
> But apparently it's not sufficient -- the new font is not used
> everywhere.  For example footnotes seem to use a different font than the
> main body of text.  (I altered the fontname to Gentium, which I like
> better, and uses a different glyph for "g" which is easy to spot ... and
> notably absent in footnote in page 5 under 1.4 Accessing a Database.)
>
> I +1 the idea of using a more complete font if it means we can render
> contributor names better, though :-)
We at Postgres Pro use the attached fop-config.xml (passed to fop as "-c
.../fop-config.xml"). Please try it and see, whether the glyphs rendered
as expected.
You can also look at the generated pdf:
https://postgrespro.com/media/docs/postgresql/12/en/postgres-A4.pdf
But π (pi) is still rendered unusual as you can see on the page 179, so
I would prefer the symbol font anyway.

Best regards,
Alexander

.

 
  
   /usr/share/fonts/truetype/ubuntu-font-family
   /usr/share/fonts/truetype/dejavu
   /usr/share/fonts/truetype/freefont
   
 


 
  
   
   
  
  
   
   
  
  
   
   
  
  
   
   
  
  
   
   
  
  
   
   
  
  
   
   
  
  
   
   
   
  
   
   
  
  
   
   
  
  
   
   
  
 




Minor fixes for PostgreSQL 13 documentation

2020-08-22 Thread Alexander Lakhin
Hello,

Please consider applying fixes for bugs (incorrect tags, redundant
spaces, etc.) I noticed while translating the documentation.

Best regards,
Alexander
diff --git a/doc/src/sgml/btree.sgml b/doc/src/sgml/btree.sgml
index d03ee4d6fa..435b7cb24d 100644
--- a/doc/src/sgml/btree.sgml
+++ b/doc/src/sgml/btree.sgml
@@ -566,7 +566,7 @@ equalimage(opcintype oid) returns bool
 
 options(relopts local_relopts *) returns void
 
- The function is passed a pointer to a local_relopts
+ The function is passed a pointer to a local_relopts
  struct, which needs to be filled with a set of operator class
  specific options.  The options can be accessed from other support
  functions using the PG_HAS_OPCLASS_OPTIONS() and
diff --git a/doc/src/sgml/datetime.sgml b/doc/src/sgml/datetime.sgml
index bbf50b76f8..d466e09381 100644
--- a/doc/src/sgml/datetime.sgml
+++ b/doc/src/sgml/datetime.sgml
@@ -564,7 +564,7 @@
   
 
   
-   PostgreSQL can accept time zone specifications that
+   PostgreSQL can accept time zone specifications that
are written according to the POSIX standard's rules
for the TZ environment
variable.  POSIX time zone specifications are
@@ -635,8 +635,8 @@
or -).  The positive sign is used for
zones west of Greenwich.  (Note that this is the
opposite of the ISO-8601 sign convention used elsewhere in
-   PostgreSQL.)  hh can have
-   one or two digits; mm
+   PostgreSQL.)  hh
+   can have one or two digits; mm
and ss (if used) must have two.
   
 
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index b1c92196e2..800a5414d4 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -9236,7 +9236,7 @@ SELECT EXTRACT(CENTURY FROM TIMESTAMP '2001-02-16 20:38:40');
   

 For timestamp values, the day (of the month) field
-(1–31) ; for interval values, the number of days
+(1–31); for interval values, the number of days

 
 
@@ -9460,7 +9460,7 @@ SELECT EXTRACT(MINUTE FROM TIMESTAMP '2001-02-16 20:38:40');
   

 For timestamp values, the number of the month
-within the year (1–12) ; for interval values,
+within the year (1–12); for interval values,
 the number of months, modulo 12 (0–11)

 
@@ -14074,7 +14074,7 @@ SELECT xmltable.*
 size_sq_km float PATH 'SIZE[@unit = "sq_km"]',
 size_other text PATH
  'concat(SIZE[@unit!="sq_km"], " ", SIZE[@unit!="sq_km"]/@unit)',
-premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified') ;
+premier_name text PATH 'PREMIER_NAME' DEFAULT 'not specified');
 
  id | ordinality | COUNTRY_NAME | country_id | size_sq_km |  size_other  | premier_name  
 ++--+++--+---
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index 754581441f..3b954b54a2 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -781,7 +781,7 @@ PGPing PQping(const char *conninfo);
  
   
PQsetSSLKeyPassHook_OpenSSL lets an application override
-   libpq's default
+   libpq's default
handling of encrypted client certificate key files using
 or interactive prompting.
 
@@ -793,20 +793,23 @@ void PQsetSSLKeyPassHook_OpenSSL(PQsslKeyPassHook_OpenSSL_type hook);
 
 int callback_fn(char *buf, int size, PGconn *conn);
 
-   which libpq will then call instead of
-   its default PQdefaultSSLKeyPassHook_OpenSSL handler. The callback
-   should determine the password for the key and copy it to result-buffer
-   buf of size size. The string in 
-   buf must be null-terminated. The callback must return the length of
-   the password stored in buf excluding the null terminator.
-   On failure, the callback should set buf[0] = '\0' and return 0.
-   See PQdefaultSSLKeyPassHook_OpenSSL in libpq's
-   source code for an example.
-  
-   
+   which libpq will then call
+   instead of its default
+   PQdefaultSSLKeyPassHook_OpenSSL handler.
+   The callback should determine the password for the key and copy
+   it to result-buffer buf of size
+   size.
+   The string in buf must be null-terminated.
+   The callback must return the length of the password stored in
+   buf excluding the null terminator.
+   On failure, the callback should set buf[0] = '\0'
+   and return 0. See PQdefaultSSLKeyPassHook_OpenSSL
+   in libpq's source code for an example.
+  
+
   
If the user specified an explicit key location,
-   its path will be in conn->pgsslkey when the callback
+   its path will be in conn->sslkey when the callback
is invoked. This will be empty if the default key path is being used.
For keys that are engine specifiers, it is up to engine implementations
whether th

Some inconsistencies in release-14

2021-09-19 Thread Alexander Lakhin
Hello hackers,

While translating names in the acknowledgment section, I've found
inconsistent spelling of several names.
1)
Dong Wook vs Lee Dong Wook

Dong Wook mentioned in
64fe120b (with e-mail sh95...@gmail.com)

Dong Wook Lee mentioned in
64725728
https://postgr.es/m/caacbyajsgrb-qc-alb0malprrgladmcbap7szxo4kcau-je...@mail.gmail.com
And the message contains
From: Dong Wook Lee 

https://velog.io/@sh95119 confirms this spelling.

But https://github.com/dongwooklee96 says "Lee Dong Wook" (in an
occidental manner).

So I think that the first spelling "Dong Wook" should be removed.

2)
Japin Li vs Li Japin

Li Japin mentioned in
e7eea52b
https://postgr.es/m/os0pr01mb6113c2499c7dc70ee55adb82fb...@os0pr01mb6113.jpnprd01.prod.outlook.com
but he presented himself in the discussion as
From: Japin Li 

In fact, we can find
From: Li Japin  back in 2020:
805b8163
https://postgr.es/m/0e2f62a2-b2f1-4052-83ae-f0bec8a75...@hotmail.com

It seems that Japin Li later changed the sender name in the e-mail client.

So I think that "Japin Li" should be used as the up-to-date spelling.

3)
Haiying Tang vs Tang Haiying
I've found 14 commits mentioning "Haiying Tang" and 4 commits with a
second spelling:

Tang Haiying
f3b141c4
https://postgr.es/m/os0pr01mb611383fa0fe92eb9de21946afb...@os0pr01mb6113.jpnprd01.prod.outlook.com
Tang, Haiying
05c8482f
https://postgr.es/m/CAJcOf-cXnB5cnMKqWEp2E2z7Mvcd04iLVmV=qpfjrr3acrt...@mail.gmail.com
47b2ed1d
https://postgr.es/m/bbbccf7a3c2d436e85d45869d612fd6b@G08CNEXMBPEKD05.g08.fujitsu.local
7e84dd21
https://postgr.es/m/3321cbcea76d4d2c8320a05c19b9304a@G08CNEXMBPEKD05.g08.fujitsu.local

But the bug report
https://postgr.es/m/16108-134692e97146b...@postgresql.org contains:
Logged by: Haiying Tang

So "Haiying Tang" looks like the preferred spelling.

4)
Shenhao Wang (in release-13) vs Wang Shenhao

Shenhao Wang found in 5 commits, while Wang Shenhao found in
6fb66c26
https://postgr.es/m/8373f61426074f2cb6be92e02f838389@G08CNEXMBPEKD06.g08.fujitsu.local
but "Shenhao Wang" is seen in the message signature.

So it looks like the preferred spelling is "Shenhao Wang".

The attached patch fixes these inconsistencies.

Best regards,
Alexander
diff --git a/doc/src/sgml/release-14.sgml b/doc/src/sgml/release-14.sgml
index 69c4a72ae7..1147db8f64 100644
--- a/doc/src/sgml/release-14.sgml
+++ b/doc/src/sgml/release-14.sgml
@@ -1671,7 +1671,7 @@ Author: Tom Lane 
 

 Add server parameter 
-to close idle sessions (Li Japin)
+to close idle sessions (Japin Li)

 

@@ -4188,7 +4188,6 @@ Author: Fujii Masao 
 Dmitry Dolgov
 Dmitry Marakasov
 Domagoj Smoljanovic
-Dong Wook
 Douglas Doole
 Duncan Sands
 Edmund Horner
@@ -4301,7 +4300,6 @@ Author: Fujii Masao 
 Laurent Hasson
 Laurenz Albe
 Lee Dong Wook
-Li Japin
 Liu Huailing
 Luc Vlaming
 Ludovic Kuty
@@ -4423,6 +4421,7 @@ Author: Fujii Masao 
 Sergey Zubkovsky
 Shawn Wang
 Shay Rojansky
+Shenhao Wang
 Shi Yu
 Shinya Kato
 Shinya Okano
@@ -4442,7 +4441,6 @@ Author: Fujii Masao 
 Takamichi Osumi
 Takashi Menjo
 Takayuki Tsunakawa
-Tang Haiying
 Tatsuhito Kasahara
 Tatsuo Ishii
 Tatsuro Yamada
@@ -4466,7 +4464,6 @@ Author: Fujii Masao 
 Vitaly Ustinov
 Vladimir Sitnikov
 Vyacheslav Shablistyy
-Wang Shenhao
 Wei Wang
 Wells Oliver
 Wenjing Zeng



Re: Some inconsistencies in release-14

2021-09-19 Thread Alexander Lakhin
Hello Tom,
19.09.2021 22:43, Tom Lane wrote:
> Alexander Lakhin  writes:
>> While translating names in the acknowledgment section, I've found
>> inconsistent spelling of several names.
> I believe we've standardized on given-name-first in these lists.
> (There was some discussion around that when the first such lists
> were made, see [1].)  People from Far Eastern cultures often write
> family name first in signatures, so it can be hard to tell whether
> it ought to be switched or not.
>
> I am not sure which of your changes are correct per this rule.
> In the v13 acknowledgements list, I see
>
> Haiying Tang
> Li Japin
> Shenhao Wang
https://www.namespedia.com says that the Haiying is a first name, and
Tang is a surname: https://www.namespedia.com/details/Tang
And most probably Li (and Lee) is a surname (as Wang):
https://en.wikipedia.org/wiki/Li_(surname_%E6%9D%8E)
So it seems that Japin Li changed his sender name according to the
Western rule.

But "Lee Dong Wook" then should be changed to "Dong Wook Lee".

I haven't checked whether all the Chinese names correspond to the rule,
I've just noticed some modified and duplicate names.
So I'm afraid that we can't ensure that all names are standardized now,
and when in doubt we should just stick to the person' preferred spelling.

Best regards,
Alexander




Re: The huge_pages parameter doesn't work when shared_memory_type is sysv

2021-10-22 Thread Alexander Lakhin
Hello Thomas,

22.10.2021 06:59, Thomas Munro wrote:
> That
> second patch included exactly such a documentation adjustment, and an
> error message too (the idea was to reject that combination on Linux
> but allow it on AIX).  Here are those bits, extracted.
>
> https://www.postgresql.org/message-id/flat/HE1PR0202MB28126DB4E0B6621CC6A1A91286D90%40HE1PR0202MB2812.eurprd02.prod.outlook.com
Thanks for the fix! It works and looks correct to me.

Best regards,
Alexander