Re: GRANT and REVOKE grammar.

2018-02-28 Thread Alexey Kuleshevich


Just noticed that formatting isn't rendered properly in the mailing list 
archive on the postgresql website. Here is the plaintext version of the 
original email:


Hi all.

The way it is described in the documentation for GRANT syntax 
(https://www.postgresql.org/docs/10/static/sql-grant.html end all prior 
versions) doesn't look quite right. According to the doc, something like that 
shouldn't be possible: GRANT SELECT(field), TRUNCATE, INSERT(abc) ON TABLE 
foobar TO alexey, namely mixing privileges with column name in parens (eg. 
INSERT(abc)) and without (eg. TRUNCATE) in the same GRANT statement, but 
clearly it is correct syntax.

So instead of current grammar in the doc:

GRANT { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | TRIGGER }
    [, ...] | ALL [ PRIVILEGES ] }
    ON { [ TABLE ] table_name [, ...]
         | ALL TABLES IN SCHEMA schema_name [, ...] }
    TO role_specification [, ...] [ WITH GRANT OPTION ]

GRANT { { SELECT | INSERT | UPDATE | REFERENCES } ( column_name [, ...] )
    [, ...] | ALL [ PRIVILEGES ] ( column_name [, ...] ) }
    ON [ TABLE ] table_name [, ...]
    TO role_specification [, ...] [ WITH GRANT OPTION ]
I suggest it should be:

GRANT { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | TRIGGER }
    [, ...] | ALL [ PRIVILEGES ] }
    ON { ALL TABLES IN SCHEMA schema_name [, ...] }
    TO role_specification [, ...] [ WITH GRANT OPTION ]

GRANT { { { SELECT | INSERT | UPDATE | REFERENCES } [ ( column_name [, ...] ) ]
        | { DELETE | TRUNCATE | TRIGGER } }
    [, ...] | ALL [ PRIVILEGES ] [ ( column_name [, ...] ) ] }
    ON [ TABLE ] table_name [, ...]
    TO role_specification [, ...] [ WITH GRANT OPTION ]
Does it make sense, or am I tripping?

Alternatively it could be:

GRANT { { SELECT | INSERT | UPDATE | DELETE | TRUNCATE | REFERENCES | TRIGGER }
    [, ...] | ALL [ PRIVILEGES ] }
    ON { [ TABLE ] table_name [, ...]
         | ALL TABLES IN SCHEMA schema_name [, ...] }
    TO role_specification [, ...] [ WITH GRANT OPTION ]

GRANT { { SELECT | INSERT | UPDATE | REFERENCES } [ ( column_name [, ...] ) ]
    [, ...] | ALL [ PRIVILEGES ] [ ( column_name [, ...] ) ] }
    ON [ TABLE ] table_name [, ...]
    TO role_specification [, ...] [ WITH GRANT OPTION ]
Note the [] around [ ( column_name [, ...] ) ], but the former is a bit 
clearer, I think.

Identical issue and solution applies to REVOKE syntax: 
https://www.postgresql.org/docs/10/static/sql-revoke.html

Forgive me if I am wrong, not a daily PostgreSQL user.



Thank you.

Alexey.



Re: improve man pages build speed

2018-02-28 Thread Peter Eisentraut
On 2/23/18 19:56, Peter Eisentraut wrote:
> The attached patch improves the build speed for the man pages on my
> system from about 50 seconds to about 15 seconds.
> 
> It looks like the stylesheets are spending a lot of time counting the
> links in the man pages so that it can put them into numbered endnotes,
> but we don't have anything like that anyway, so we can save a lot of
> time by turning this off.  (I suppose we'd have to turn it back on if we
> have have content like that, but we've never had anything like that
> before, so it doesn't seem particularly pressing.)

committed

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



Missing steps for "Building with Visual C++ or the Microsoft Windows SDK"

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

Page: https://www.postgresql.org/docs/9.6/static/install-windows-full.html
Description:

Hi, 
I am not very experienced and some of these corrections may be trivial or
childish.

I have been following the steps for "Building with Visual C++ or the
Microsoft Windows SDK" for 9.6. using Visual Studio 2015.
Everything was pretty straightforward aside from a few things:

- I didn't find a config.pl file and wasn't sure if I created it what
exactly to put in it (I thought about copy/paste from the
"config_default.pl" but decided not to). Instead I added all the required
libraries to the system PATH. 

- After having successfully run "build" and "install" I was having issues
running the regression tests. "vcregress check" ran fine but after that I
kept getting this error:
-
psql: could not connect to server: Connection refused (0x274D/10061)
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
-- 
Obviously, there was no server running. But I was never instructed to create
a data directory or user, and run "initDB" and "pgstl Start" before this
step. I think that should be added somewhere between to avoid confusion. (I
may be completely wrong and have missed some step somewhere)

Thanks 
Michael 


Re: Missing steps for "Building with Visual C++ or the Microsoft Windows SDK"

2018-02-28 Thread Craig Ringer
On 1 March 2018 at 00:31, PG Doc comments form 
wrote:

> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/9.6/static/install-windows-full.html
> Description:
>
> Hi,
> I am not very experienced and some of these corrections may be trivial or
> childish.
>
> I have been following the steps for "Building with Visual C++ or the
> Microsoft Windows SDK" for 9.6. using Visual Studio 2015.
> Everything was pretty straightforward aside from a few things:
>
> - I didn't find a config.pl file and wasn't sure if I created it what
> exactly to put in it (I thought about copy/paste from the
> "config_default.pl" but decided not to). Instead I added all the required
> libraries to the system PATH.
>

It wouldn't hurt to spell that out explicitly, though I would've assumed it
was implied by the filename and presence of a config_default.pl .

Please send a docs patch.


>
> - After having successfully run "build" and "install" I was having issues
> running the regression tests. "vcregress check" ran fine but after that I
> kept getting this error:
> -
> psql: could not connect to server: Connection refused (0x274D/10061)
> Is the server running on host "localhost" (::1) and accepting
> TCP/IP connections on port 5432?
> --
> Obviously, there was no server running. But I was never instructed to
> create
> a data directory or user, and run "initDB" and "pgstl Start" before this
> step. I think that should be added somewhere between to avoid confusion. (I
> may be completely wrong and have missed some step somewhere)
>


vcregress check should create a temporary datadir and start a temporary
server. If it fails to do so, there's something wrong with your setup. It's
likely this is related to the missing config.pl .

vcregress installcheck (different command) requires an existing running
server. But that's not what you ran.

-- 
 Craig Ringer   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services