Re: First SVG graphic

2019-02-07 Thread Peter Eisentraut
First, let's fix some of these whitespace errors:

firstSvg_2.patch:677: trailing whitespace.
   @@ -152,15 +156,15 @@ postgres.txt: postgres.html
>  postgres.pdf:
>   $(error Invalid target;  use postgres-A4.pdf or postgres-US.pdf as targets)
>
> -%-A4.fo: stylesheet-fo.xsl %.sgml $(ALLSGML)
> +%-A4.fo: stylesheet-fo.xsl %.sgml
>   $(XMLLINT) $(XMLINCLUDE) --noout --valid $(word 2,$^)
>   $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) --stringparam paper.type A4 -o 
> $@ $(wordlist 1,2,$^)
>
> -%-US.fo: stylesheet-fo.xsl %.sgml $(ALLSGML)
> +%-US.fo: stylesheet-fo.xsl %.sgml
>   $(XMLLINT) $(XMLINCLUDE) --noout --valid $(word 2,$^)
>   $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) --stringparam paper.type 
> USletter -o $@ $(wordlist 1,2,$^)
>
> -%.pdf: %.fo
> +%.pdf: %.fo $(ALLSGML) $(SVGSRC)
>   $(FOP) -fo $< -pdf $@
>

This seems a bit wrong.  The .fo target does depend on ALLSGML.  The
.pdf target does not, but it presumably does depend on SVGSRC.

The variable name SVGSRC is a bit confusing.  What is it the source of?

> @@ -209,7 +213,7 @@ check: postgres.sgml $(ALLSGML) check-tabs
>  install: install-html install-man
>
>  installdirs:
> - $(MKDIR_P) '$(DESTDIR)$(htmldir)'/html $(addprefix 
> '$(DESTDIR)$(mandir)'/man, 1 3 $(sqlmansectnum))
> + $(MKDIR_P) '$(DESTDIR)$(htmldir)'/html/svg html/svg $(addprefix 
> '$(DESTDIR)$(mandir)'/man, 1 3 $(sqlmansectnum))
>
>  # If the install used a man directory shared with other applications, this 
> will remove all files.
>  uninstall:

html/svg is not an installation directory.  You need to create it
somewhere else.

> + 
> +  Lists of Figures, Tables and Examples
> +  
> +   List of Figures
> +   
> +  
> +  
> +   List of Tables
> +   
> +  
> +  
> +   List of Examples
> +   
> +  
> + 

These ought to be created by the stylesheet.  We have probably turned
them off somewhere, so you should see where you can turn them on.

> diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
> index 9e0bb93f08..d31ee2d210 100644
> --- a/doc/src/sgml/ref/pg_dump.sgml
> +++ b/doc/src/sgml/ref/pg_dump.sgml
> @@ -73,6 +73,21 @@
> architectures.
>
>
> +  
> +   pg_dump: Formats and Restore Proceedings

This doesn't work for man page output.

I think we should avoid putting images into reference pages.  This one
could perhaps go into the Backup chapter.

Also, it should be linked to from somewhere.  An image that's just
floating around and not referred to in the text seems odd.

Also we tend to use hyphens instead of underscores for IDs.  (At some
point, underscores where not allowed.  I'm surprised that that's no
longer the case.)  I also wouldn't put "_svg" into the ID.  The format
is irrelevant to the ID.

-- 
Peter Eisentraut  http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



What does the value 5874897 AD mean? Which year, month, day, please?

2019-02-07 Thread PG Doc comments form
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/11/datatype-datetime.html
Description:

See also
https://stackoverflow.com/questions/29434748/what-does-bc-date-mean-in-postgresql.

Add a note about how the date/timestamp is internally represented, please.
E.g.
https://docs.teradata.com/reader/S0Fw2AVH8ff3MDA0wDOHlQ/dkWLOva_L12uKvSnUcJQsQ.


RE: What does the value 5874897 AD mean? Which year, month, day, please?

2019-02-07 Thread Vianello, Daniel A
> What does the value 5874897 AD mean? Which year, month, day, please?

The maximum allowed date (not timestamp) is Dec 31st in the year 5874897, which 
you can test with the query: select '5874897-12-31'::date; and select 
'5874897-12-31'::date + interval '1 day'; The latter query fails with "Error: 
date out of range for timestamp".  

I logged nearly this same response for you on StackOverflow, too.

E-MAIL CONFIDENTIALITY NOTICE: 
The contents of this e-mail message and any attachments are intended solely for 
the addressee(s) and may contain confidential and/or legally privileged 
information. If you are not the intended recipient of this message or if this 
message has been addressed to you in error, please immediately alert the sender 
by reply e-mail and then delete this message and any attachments. If you are 
not the intended recipient, you are notified that any use, dissemination, 
distribution, copying, or storage of this message or any attachment is strictly 
prohibited.


Re: First SVG graphic

2019-02-07 Thread Jürgen Purtz

On 07.02.19 12:06, Peter Eisentraut wrote:


First, let's fix some of these whitespace errors:

firstSvg_2.patch:677: trailing whitespace.
   

Done.


Let's not use mixed-case file names:

Inkscape/
PageLayout.svg
gin.svg
pgDump.svg

Done.

@@ -152,15 +156,15 @@ postgres.txt: postgres.html
  postgres.pdf:
   $(error Invalid target;  use postgres-A4.pdf or postgres-US.pdf as targets)

-%-A4.fo: stylesheet-fo.xsl %.sgml $(ALLSGML)
+%-A4.fo: stylesheet-fo.xsl %.sgml
   $(XMLLINT) $(XMLINCLUDE) --noout --valid $(word 2,$^)
   $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) --stringparam paper.type A4 -o $@ 
$(wordlist 1,2,$^)

-%-US.fo: stylesheet-fo.xsl %.sgml $(ALLSGML)
+%-US.fo: stylesheet-fo.xsl %.sgml
   $(XMLLINT) $(XMLINCLUDE) --noout --valid $(word 2,$^)
   $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) --stringparam paper.type USletter 
-o $@ $(wordlist 1,2,$^)

-%.pdf: %.fo
+%.pdf: %.fo $(ALLSGML) $(SVGSRC)
   $(FOP) -fo $< -pdf $@


This seems a bit wrong.  The .fo target does depend on ALLSGML.  The
.pdf target does not, but it presumably does depend on SVGSRC.
It's a transitive dependency: the pdf target is triggered after changes 
in svg (or sgml), this triggers the fo targets. Therefore it's not 
necessary to have svg (or sgml) dependencies at the fo level.

The variable name SVGSRC is a bit confusing.  What is it the source of?
The variable SVGSRC points to all svg-files, similar to ALLSGML which 
points to the sgml files. Whenever any of them changes, certain targets 
will fire.

@@ -209,7 +213,7 @@ check: postgres.sgml $(ALLSGML) check-tabs
  install: install-html install-man

  installdirs:
- $(MKDIR_P) '$(DESTDIR)$(htmldir)'/html $(addprefix '$(DESTDIR)$(mandir)'/man, 
1 3 $(sqlmansectnum))
+ $(MKDIR_P) '$(DESTDIR)$(htmldir)'/html/svg html/svg $(addprefix 
'$(DESTDIR)$(mandir)'/man, 1 3 $(sqlmansectnum))

  # If the install used a man directory shared with other applications, this 
will remove all files.
  uninstall:

html/svg is not an installation directory.  You need to create it
somewhere else.
Please help. I haven't understood the distinction between installation 
directory and DESTDIR. On the other hand, in the Makefile there is a - 
redundant - command within the html-stamp target: $(MKDIR_P) html/svg. 
But this will run frequently, which is not necessary.

+ 
+  Lists of Figures, Tables and Examples
+  
+   List of Figures
+   
+  
+  
+   List of Tables
+   
+  
+  
+   List of Examples
+   
+  
+ 

These ought to be created by the stylesheet.  We have probably turned
them off somewhere, so you should see where you can turn them on.


There is a simple mechanism to create those list of figures: change line 
55 of stylesheet-html-common.xsl to "book toc,title,*figure*". But the 
result is ugly - see attached screenshot. The list is out-of-line. 
Additionally, in the future we will have many figures (and examples and 
tables). This will lead to similar problems we actually faced with the 
release notes. The proposed solution moves this inflation of lists to 
deeper levels of the TOC. We can and have defined theirs layout within 
stylesheet-common.xsl.



diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
index 9e0bb93f08..d31ee2d210 100644
--- a/doc/src/sgml/ref/pg_dump.sgml
+++ b/doc/src/sgml/ref/pg_dump.sgml
@@ -73,6 +73,21 @@
 architectures.


+  
+   pg_dump: Formats and Restore Proceedings

This doesn't work for man page output.

I think we should avoid putting images into reference pages.  This one
could perhaps go into the Backup chapter.


What is the problem here? Actually I don't have enough time to evaluate 
it in deep. If it is an urgent problem (I have seen that the 
commitfest-entry is tagged as "release 12") we shall shift the pg_dump 
figure to a later release.


I think that the Backup chapter isn't a good place for this because it 
does not explain the complete interaction between pg_dump, psql and restore.



Also, it should be linked to from somewhere.  An image that's just
floating around and not referred to in the text seems odd.

Also we tend to use hyphens instead of underscores for IDs.  (At some
point, underscores where not allowed.  I'm surprised that that's no
longer the case.)
Done. (But I hate the use of the minus-signs within any identifier of 
any language. For me it's an operator.)

   I also wouldn't put "_svg" into the ID.  The format
is irrelevant to the ID.

I changed _svg to _figure. I agree that the format is irrelevant. But it 
may be of interest, whether it is an id to a text or a figure.



Kind regards, Jürgen


diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile
index 8326c7c673..1179d29096 100644
--- a/doc/src/sgml/Makefile
+++ b/doc/src/sgml/Makefile
@@ -57,6 +57,8 @@ GENERATED_SGML = version.sgml \
 
 ALLSGML := $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml) $(GENERATED_SGML)
 
+SVGSRC := $(wildcard $(srcdir)/svg/*.svg)
+
 
 ##
 ## Man pages
@@ -125,10 +127,12 @@ endif
 
 html: html-stamp
 
-html-stamp:

Typo in Table 8.7 bytea Literal Escaped Octets

2019-02-07 Thread PG Doc comments form
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/11/datatype-binary.html
Description:

In "Table 8.7. bytea Literal Escaped Octets", the backslash character should
be escaped as '\\' or '\134', not '\' or '\\134'.

https://www.postgresql.org/docs/11/datatype-binary.html#DATATYPE-BINARY-SQLESC