Re: optionally schema-qualified for table_name

2020-03-24 Thread Bruce Momjian
On Tue, Mar 24, 2020 at 09:35:25PM +0100, Peter Eisentraut wrote:
> On 2020-03-23 02:27, Bruce Momjian wrote:
> > On Sun, Mar 22, 2020 at 06:20:04PM -0400, Tom Lane wrote:
> > > Bruce Momjian  writes:
> > > > On Sun, Mar 22, 2020 at 03:05:01PM -0400, Tom Lane wrote:
> > > > > I don't really think this is an improvement, mainly because that
> > > > > error message is inventing a notation that we do not use in any
> > > > > other error message.
> > > 
> > > > What do you suggest?  The current message is:
> > > 
> > > > Specify OWNED BY table.column or OWNED BY NONE.
> > > 
> > > Yeah, and I think that's okay as-is, or at least we can't make it better
> > > without fairly whole-sale changes of our documentation practices.
> > > The fact that a table name can be schema-qualified is usually implicit,
> > > and I don't see why this place cries out for making it explicit
> > > more than other places.  You could as well complain that there's
> > > nothing explicit here about double-quoting practices.
> > 
> > OK, I will do just the documentation patch for this then.
> 
> The same criticism applies to the documentation patch, I think.  We don't
> usually make the schema part explicit.

That is a good point. I used CREATE VIEW as an example because that is
what the user reported, but it seems only create_view and reindexed use
a schema name qualification:

$ grep  -l 'schema' *.sgml
create_view.sgml
reindexdb.sgml

The reindexdb use is because of -S (reindex schema), which makes sense. 
The create view case is used in an example of CREATE RECURSIVE VIEW and
should probably be removed.

-- 
  Bruce Momjian  https://momjian.us
  EnterpriseDB https://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+  Ancient Roman grave inscription +




Re: optionally schema-qualified for table_name

2020-03-24 Thread Peter Eisentraut

On 2020-03-23 02:27, Bruce Momjian wrote:

On Sun, Mar 22, 2020 at 06:20:04PM -0400, Tom Lane wrote:

Bruce Momjian  writes:

On Sun, Mar 22, 2020 at 03:05:01PM -0400, Tom Lane wrote:

I don't really think this is an improvement, mainly because that
error message is inventing a notation that we do not use in any
other error message.



What do you suggest?  The current message is:



Specify OWNED BY table.column or OWNED BY NONE.


Yeah, and I think that's okay as-is, or at least we can't make it better
without fairly whole-sale changes of our documentation practices.
The fact that a table name can be schema-qualified is usually implicit,
and I don't see why this place cries out for making it explicit
more than other places.  You could as well complain that there's
nothing explicit here about double-quoting practices.


OK, I will do just the documentation patch for this then.


The same criticism applies to the documentation patch, I think.  We 
don't usually make the schema part explicit.


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




Re: terminology in example

2020-03-24 Thread Bruce Momjian
On Tue, Mar 24, 2020 at 03:57:25PM +, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
> 
> Page: https://www.postgresql.org/docs/12/ddl-inherit.html
> Description:
> 
> In the example on this page: 
> https://www.postgresql.org/docs/current/ddl-inherit.html
> the word 'altitude' should be replaced with 'elevation'.

Yes, I see your point:


https://mapscaping.com/blogs/geo-candy/what-is-the-difference-between-elevation-relief-and-altitude

-- 
  Bruce Momjian  https://momjian.us
  EnterpriseDB https://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+  Ancient Roman grave inscription +




terminology in example

2020-03-24 Thread PG Doc comments form
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/12/ddl-inherit.html
Description:

In the example on this page: 
https://www.postgresql.org/docs/current/ddl-inherit.html
the word 'altitude' should be replaced with 'elevation'.


Re: documentation pdf build fail (HEAD)

2020-03-24 Thread Tom Lane
Peter Eisentraut  writes:
> On 2020-03-24 15:31, Tom Lane wrote:
>> The problem seems to be that cedffbdb8
>> introduced some broken table markup.  I wonder why xmllint
>> failed to catch it?

> It's not a validity issue in the DocBook markup.  The error comes from 
> FOP, which complains because it requires the column count, but other 
> processors don't necessarily require it.

Maybe not, but if the count is there, shouldn't it be checked?

In this particular case, the table was obviously broken if you looked
at the rendered HTML, but I'd kind of expect the toolchain to provide
basic sanity checks without having to do that.

regards, tom lane




Re: documentation pdf build fail (HEAD)

2020-03-24 Thread Peter Eisentraut

On 2020-03-24 15:31, Tom Lane wrote:

The problem seems to be that cedffbdb8
introduced some broken table markup.  I wonder why xmllint
failed to catch it?


It's not a validity issue in the DocBook markup.  The error comes from 
FOP, which complains because it requires the column count, but other 
processors don't necessarily require it.


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




Re: documentation pdf build fail (HEAD)

2020-03-24 Thread Tom Lane
Erikjan Rijkers  writes:
> I build the pdf (for HEAD) almost daily without problems, but at the 
> moment I get the error below.
> I am not sure whether to blame my particular setup (debian stretch), or 
> whether there might be an error in the .sgml.  The html files still 
> build OK.

Yeah, I see it too.  The problem seems to be that cedffbdb8
introduced some broken table markup.  I wonder why xmllint
failed to catch it?  While catching morerows mistakes might be
hard in general, it shouldn't have been difficult to notice that
this table row contained more columns than the table spec allowed.

> If anyone has a suggestion on how to tackle this I'd be grateful.

The "position" noted in the error report seems to be a line number
and column number in the .fo file.  Once you go there and look around
at surrounding text, you can locate the matching .sgml input and then
try to eyeball what's wrong with it.

Fix pushed.

regards, tom lane




Re: Examples required in || 5.10. Table Partitioning

2020-03-24 Thread Bruce Momjian
On Tue, Mar 24, 2020 at 12:36:14PM +0530, Tanay Purnaye wrote:
> Hello Bruce,
> 
> Apologies for late reply.
> Thank you for acknowledging my email.
> 
> If I have any doubts regarding partition,indixing or query tuning in feature
> may I email you?

No, I suggest you sent it to the appropriate email list:

https://www.postgresql.org/community

You can also try the #postgresql IRC channel on irc.freenode.net.  See
the PostgreSQL FAQ for more information.

---



> 
> Kind regards,
> Tanay 
> 
> 
> On Sun, Mar 15, 2020, 1:12 AM Bruce Momjian  wrote:
> 
> On Thu, Feb  6, 2020 at 12:23:46PM +, PG Doc comments form wrote:
> > The following documentation comment has been logged on the website:
> >
> > Page: https://www.postgresql.org/docs/12/ddl-partitioning.html
> > Description:
> >
> > Hello ,
> >
> > As I'm searching for the official documentation of Hash Partition and
> List
> > Partition with example with more description the only information is
> found
> > is  as below :
> >
> > List Partitioning
> > The table is partitioned by explicitly listing which key values appear 
> in
> > each partition.
> >
> > Hash Partitioning
> > The table is partitioned by specifying a modulus and a remainder for 
> each
> > partition. Each partition will hold the rows for which the hash value of
> the
> > partition key divided by the specified modulus will produce the 
> specified
> > remainder.
> >
> > But how to create and manage these above 2 partition is not explained in
> > documentation properly officially.for further information related to
> these 2
> > partition we need to search private blogs,because of lack of information
> > provided in the documentation 5.10. Table Partitioning I only saw the
> Range
> > partition example throughout the Table Partitioning .
> >
> > I request you to modify the 5.10. Table Partitioning section and make it
> > more informative as Table Partition is very important in PostgreSQL .
> 
> Well, there are examples in the CREATE TABLE manual page:
> 
>         https://www.postgresql.org/docs/12/sql-createtable.html
> 
>         When creating a hash partition, a modulus and remainder must be
>         specified. The modulus must be a positive integer, and the
> remainder
>         must be a non-negative integer less than the modulus. Typically,
> when
>         initially setting up a hash-partitioned table, you should choose a
>         modulus equal to the number of partitions and assign every table
> the
>         same modulus and a different remainder (see examples, below).
> However,
>         it is not required that every partition have the same modulus, 
> only
> that
>         every modulus which occurs among the partitions of a
> hash-partitioned
>         table is a factor of the next larger modulus. This allows the
> number of
>         partitions to be increased incrementally without needing to move
> all the
>         data at once. For example, suppose you have a hash-partitioned
> table
>         with 8 partitions, each of which has modulus 8, but find it
> necessary to
>         increase the number of partitions to 16. You can detach one of the
>         modulus-8 partitions, create two new modulus-16 partitions 
> covering
> the
>         same portion of the key space (one with a remainder equal to the
>         remainder of the detached partition, and the other with a 
> remainder
>         equal to that value plus 8), and repopulate them with data. You 
> can
> then
>         repeat this -- perhaps at a later time -- for each modulus-8
> partition
>         until none remain. While this may still involve a large amount of
> data
>         movement at each step, it is still better than having to create a
> whole
>         new table and move all the data at once.
> 
>         CREATE TABLE orders (
>             order_id     bigint not null,
>             cust_id      bigint not null,
>             status       text
>         ) PARTITION BY HASH (order_id);
> 
>         CREATE TABLE orders_p1 PARTITION OF orders
>             FOR VALUES WITH (MODULUS 4, REMAINDER 0);
>         CREATE TABLE orders_p2 PARTITION OF orders
>             FOR VALUES WITH (MODULUS 4, REMAINDER 1);
>         CREATE TABLE orders_p3 PARTITION OF orders
>             FOR VALUES WITH (MODULUS 4, REMAINDER 2);
>         CREATE TABLE orders_p4 PARTITION OF orders
>             FOR VALUES WITH (MODULUS 4, REMAINDER 3);
> 
> 
>         CREATE TABLE cities (
>             city_id      bigserial not null,
>             name         text not null,
>             population   

Re: documentation pdf build fail (HEAD)

2020-03-24 Thread Jürgen Purtz

Ubuntu 18.04: no crash, but possibly a side effect:

[INFO] FOUserAgent - Rendered page #2685.
[INFO] FOUserAgent - Rendered page #2686.
[INFO] FOUserAgent - Rendered page #2687.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"function-encode" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"function-decode" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-altercollation-notes-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-altertable-notes-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-createaggregate-notes-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-createindex-storage-parameters-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-createindex-concurrently-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-createtable-storage-parameters-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-createtable-compatibility-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-declare-notes-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-inserting-params-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-on-conflict-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-prepare-examples-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-reindex-concurrently-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-with-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-from-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-where-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-groupby-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-having-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-window-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-select-list-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-distinct-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-union-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-intersect-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-except-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-orderby-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-limit-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"sql-for-update-share-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"pg-dump-examples-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"app-psql-patterns-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"app-psql-variables-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"app-psql-interpolation-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"app-psql-prompting-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"app-psql-environment-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"app-psql-examples-title" found.
[WARN] FOUserAgent - Destination: Unresolved ID reference 
"app-postgres-single-user-title" found.

[INFO] FOUserAgent - Rendered page #2688.
[WARN] FOUserAgent - Page 226: Unresolved ID reference "function-decode" 
found.
[WARN] FOUserAgent - Page 226: Unresolved ID reference "function-encode" 
found.


Kind regards, J. Purtz





documentation pdf build fail (HEAD)

2020-03-24 Thread Erikjan Rijkers

Hello,

I build the pdf (for HEAD) almost daily without problems, but at the 
moment I get the error below.


I am not sure whether to blame my particular setup (debian stretch), or 
whether there might be an error in the .sgml.  The html files still 
build OK.


If anyone has a suggestion on how to tackle this I'd be grateful.

thanks,

Erik Rijkers



[...]
[INFO] FOUserAgent - Rendered page #526.
[INFO] FOUserAgent - Rendered page #527.
[INFO] FOUserAgent - Rendered page #528.
[INFO] FOUserAgent - Rendered page #529.
[[ERROR] FOP - Exception org.apache.fop.fo.ValidationException: The column-number or number of 
cells in the row overflows the number of fo:table-columns specified for 
the table. (See position 47337:52207)
javax.xml.transform.TransformerException: 
org.apache.fop.fo.ValidationException: The column-number or number of 
cells in the row overflows the number of fo:table-columns specified for 
the table. (See position 47337:52207)>org.apache.fop.apps.FOPException: 
org.apache.fop.fo.ValidationException: The column-number or number of 
cells in the row overflows the number of fo:table-columns specified for 
the table. (See position 47337:52207)
javax.xml.transform.TransformerException: 
org.apache.fop.fo.ValidationException: The column-number or number of 
cells in the row overflows the number of fo:table-columns specified for 
the table. (See position 47337:52207)
at 
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:289)
at 
org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)

at org.apache.fop.cli.Main.startFOP(Main.java:186)
at org.apache.fop.cli.Main.main(Main.java:217)
Caused by: javax.xml.transform.TransformerException: 
org.apache.fop.fo.ValidationException: The column-number or number of 
cells in the row overflows the number of fo:table-columns specified for 
the table. (See position 47337:52207)
at 
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:502)
at 
org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:286)

... 3 more
Caused by: org.apache.fop.fo.ValidationException: The column-number or 
number of cells in the row overflows the number of fo:table-columns 
specified for the table. (See position 47337:52207)
at 
org.apache.fop.events.ValidationExceptionFactory.createException(ValidationExceptionFactory.java:38)
at 
org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:58)
at 
org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:175)

at com.sun.proxy.$Proxy4.tooManyCells(Unknown Source)
at 
org.apache.fop.fo.flow.table.TableCellContainer.addTableCellChild(TableCellContainer.java:75)
at 
org.apache.fop.fo.flow.table.TableRow.addChildNode(TableRow.java:95)
at 
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:324)
at 
org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:179)
at 
org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1073)
at 
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at 
org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
at 
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown 
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown 
Source)
at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown 
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown 
Source)

at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown 
Source)
at 
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at 
org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485)

... 4 more





Re: Examples required in || 5.10. Table Partitioning

2020-03-24 Thread Tanay Purnaye
Hello Bruce,

Apologies for late reply.
Thank you for acknowledging my email.

If I have any doubts regarding partition,indixing or query tuning in
feature may I email you?

Kind regards,
Tanay


On Sun, Mar 15, 2020, 1:12 AM Bruce Momjian  wrote:

> On Thu, Feb  6, 2020 at 12:23:46PM +, PG Doc comments form wrote:
> > The following documentation comment has been logged on the website:
> >
> > Page: https://www.postgresql.org/docs/12/ddl-partitioning.html
> > Description:
> >
> > Hello ,
> >
> > As I'm searching for the official documentation of Hash Partition and
> List
> > Partition with example with more description the only information is
> found
> > is  as below :
> >
> > List Partitioning
> > The table is partitioned by explicitly listing which key values appear in
> > each partition.
> >
> > Hash Partitioning
> > The table is partitioned by specifying a modulus and a remainder for each
> > partition. Each partition will hold the rows for which the hash value of
> the
> > partition key divided by the specified modulus will produce the specified
> > remainder.
> >
> > But how to create and manage these above 2 partition is not explained in
> > documentation properly officially.for further information related to
> these 2
> > partition we need to search private blogs,because of lack of information
> > provided in the documentation 5.10. Table Partitioning I only saw the
> Range
> > partition example throughout the Table Partitioning .
> >
> > I request you to modify the 5.10. Table Partitioning section and make it
> > more informative as Table Partition is very important in PostgreSQL .
>
> Well, there are examples in the CREATE TABLE manual page:
>
> https://www.postgresql.org/docs/12/sql-createtable.html
>
> When creating a hash partition, a modulus and remainder must be
> specified. The modulus must be a positive integer, and the
> remainder
> must be a non-negative integer less than the modulus. Typically,
> when
> initially setting up a hash-partitioned table, you should choose a
> modulus equal to the number of partitions and assign every table
> the
> same modulus and a different remainder (see examples, below).
> However,
> it is not required that every partition have the same modulus,
> only that
> every modulus which occurs among the partitions of a
> hash-partitioned
> table is a factor of the next larger modulus. This allows the
> number of
> partitions to be increased incrementally without needing to move
> all the
> data at once. For example, suppose you have a hash-partitioned
> table
> with 8 partitions, each of which has modulus 8, but find it
> necessary to
> increase the number of partitions to 16. You can detach one of the
> modulus-8 partitions, create two new modulus-16 partitions
> covering the
> same portion of the key space (one with a remainder equal to the
> remainder of the detached partition, and the other with a remainder
> equal to that value plus 8), and repopulate them with data. You
> can then
> repeat this -- perhaps at a later time -- for each modulus-8
> partition
> until none remain. While this may still involve a large amount of
> data
> movement at each step, it is still better than having to create a
> whole
> new table and move all the data at once.
>
> CREATE TABLE orders (
> order_id bigint not null,
> cust_id  bigint not null,
> status   text
> ) PARTITION BY HASH (order_id);
>
> CREATE TABLE orders_p1 PARTITION OF orders
> FOR VALUES WITH (MODULUS 4, REMAINDER 0);
> CREATE TABLE orders_p2 PARTITION OF orders
> FOR VALUES WITH (MODULUS 4, REMAINDER 1);
> CREATE TABLE orders_p3 PARTITION OF orders
> FOR VALUES WITH (MODULUS 4, REMAINDER 2);
> CREATE TABLE orders_p4 PARTITION OF orders
> FOR VALUES WITH (MODULUS 4, REMAINDER 3);
>
>
> CREATE TABLE cities (
> city_id  bigserial not null,
> name text not null,
> population   bigint
> ) PARTITION BY LIST (left(lower(name), 1));
>
> CREATE TABLE cities_ab
> PARTITION OF cities (
> CONSTRAINT city_id_nonzero CHECK (city_id != 0)
> ) FOR VALUES IN ('a', 'b');
>
> Is that sufficient?
>
> --
>   Bruce Momjian  https://momjian.us
>   EnterpriseDB https://enterprisedb.com
>
> + As you are, so once was I.  As I am, so you will be. +
> +  Ancient Roman grave inscription +
>