pg_buffercache query example results misleading, grouping by just relname, needs schema_name

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

Page: https://www.postgresql.org/docs/12/pgbuffercache.html
Description:

The pg_buffercache query example results are misleading. The "group by" uses
just by relname. It needs to include pg_namespace.nspname, without it, if
the same object exists in multiple schemas, the buffer count is summed for
those multiple distinct objects.  
In: https://www.postgresql.org/docs/12/pgbuffercache.html
Alternative SQL (the count is now correct for tables in multiple schemas):
SELECT ts.nspname AS schema_name,c.relname, count(*) AS buffers
 FROM pg_buffercache b INNER JOIN pg_class c
 ON b.relfilenode = pg_relation_filenode(c.oid) AND
b.reldatabase IN (0, (SELECT oid FROM pg_database
  WHERE datname = current_database()))
 JOIN pg_namespace ts ON ts.oid = c.relnamespace
 GROUP BY ts.nspname,c.relname
 ORDER BY buffers DESC
 LIMIT 10;

Example Results:
Current Query returns 1 row with buffer count summed for 3 tables:
relname buffers
tab172401

Modified Query:
schema_name relname buffers
schema1 tab11883
schema2 tab169961
schema3 tab1557


role creation

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

Page: https://www.postgresql.org/docs/11/role-attributes.html
Description:

The reference for `CREATE ROLE` has the following text in the `NOTES`
section regarding the `CREATEROLE`  privilege:

>Be careful with the CREATEROLE privilege. There is no concept of 
inheritance for the privileges of a CREATEROLE-role. That means that even
if a role does not have a certain privilege but is allowed to create other

roles, it can easily create another role with different privileges than 
its own (except for creating roles with superuser privileges). For
example,
if the role “user” has the CREATEROLE privilege but not the CREATEDB
privilege, nonetheless it can create a new role with the CREATEDB 
privilege. Therefore, regard roles that have the CREATEROLE privilege as
almost-superuser-roles.

Something like that is should be also on this page in the `role creation`
section.


LOGIN/NOLOGIN in psql

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

Page: https://www.postgresql.org/docs/11/sql-createrole.html
Description:

Please add something like this to the LOGIN/NOLOGIN part:

The `psql` commands `\du` and `\dg` show `Cannot login` for roles with
`NOLOGIN` and nothing for roles with `LOGIN`. For other attributes `psql`
show their positive forms.


Re: LOGIN/NOLOGIN in psql

2020-02-13 Thread David G. Johnston
On Thu, Feb 13, 2020 at 2:53 AM PG Doc comments form 
wrote:

> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/11/sql-createrole.html
> Description:
>
> Please add something like this to the LOGIN/NOLOGIN part:
>
> The `psql` commands `\du` and `\dg` show `Cannot login` for roles with
> `NOLOGIN` and nothing for roles with `LOGIN`. For other attributes `psql`
> show their positive forms.
>

I suspect it is intentional that none (I think...) of the material in the
SQL Commands section mentions psql.  I can see changing the psql page to
note the absence of a positive form presentation for this particular
attribute under the descriptions of the \du and \dg meta-commands.

David J.


Re: LOGIN/NOLOGIN in psql

2020-02-13 Thread Andreas Heiduk
Am 13.02.20 um 15:55 schrieb David G. Johnston:
> On Thu, Feb 13, 2020 at 2:53 AM PG Doc comments form
> mailto:nore...@postgresql.org>> wrote:
> 
> The following documentation comment has been logged on the website:
> 
> Page: https://www.postgresql.org/docs/11/sql-createrole.html
> Description:
> 
> Please add something like this to the LOGIN/NOLOGIN part:
> 
> The `psql` commands `\du` and `\dg` show `Cannot login` for roles with
> `NOLOGIN` and nothing for roles with `LOGIN`. For other attributes
> `psql`
> show their positive forms.
> 
> 
> I suspect it is intentional that none (I think...) of the material in
> the SQL Commands section mentions psql.  I can see changing the psql
> page to note the absence of a positive form presentation for this
> particular attribute under the descriptions of the \du and \dg
> meta-commands.
> 
> David J.

Tinkering a bit more: The `INHERIT` attribute is also not shown - only
the negative form. Therefore:

I assume now, that `psql` only show these attributes, which are not in
the default state as explained in the `CREATE ROLE` page.

Explaining that an showing the possibly shown values in the mentioned
sections of `psql` would be a good idea.

Andreas H.




PDF doc build is broken on recent Fedora

2020-02-13 Thread Tom Lane
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?

regards, tom lane