Обсуждение: please inform data_directory

Поиск
Список
Период
Сортировка

please inform data_directory

От
PG Doc comments form
Дата:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/10/static/functions-admin.html
Description:

It is impossible to use pg_read_file(), etc. functions without 
SHOW  data_directory

Re: please inform data_directory

От
Bruce Momjian
Дата:
On Sun, Sep  9, 2018 at 11:41:36PM +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
> 
> Page: https://www.postgresql.org/docs/10/static/functions-admin.html
> Description:
> 
> It is impossible to use pg_read_file(), etc. functions without 
> SHOW  data_directory

What do you mean by that?  I can call pg_read_file() before calling
'SHOW  data_directory'.  Are you saying that pg_read_file can only read
in the data_directory?  It is designed that way.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

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


Re: please inform data_directory

От
Michael Paquier
Дата:
On Wed, Oct 10, 2018 at 03:59:59PM -0400, Bruce Momjian wrote:
> What do you mean by that?  I can call pg_read_file() before calling
> 'SHOW  data_directory'.  Are you saying that pg_read_file can only read
> in the data_directory?  It is designed that way.

Please note that v11 has added a new default role called
pg_read_server_files, which allows a role to read files out of the data
directory which is the default.
--
Michael

Вложения

Re: please inform data_directory

От
Peter Krauss
Дата:
Hi, trying to explain again, 
the "SHOW  data_directory"  is an information that not exist in the guide today, but must to exist... is a suggestion to add information, a middle-expert or non-extert reader need it.


On Wed, Oct 10, 2018 at 4:59 PM Bruce Momjian <bruce@momjian.us> wrote:
On Sun, Sep  9, 2018 at 11:41:36PM +0000, PG Doc comments form wrote:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/10/static/functions-admin.html
> Description:
>
> It is impossible to use pg_read_file(), etc. functions without
> SHOW  data_directory

What do you mean by that?  I can call pg_read_file() before calling
'SHOW  data_directory'.  Are you saying that pg_read_file can only read
in the data_directory?  It is designed that way.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

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

Re: please inform data_directory

От
Bruce Momjian
Дата:
On Thu, Oct 11, 2018 at 03:50:09PM -0300, Peter Krauss wrote:
> Hi, trying to explain again, 
> the "SHOW  data_directory"  is an information that not exist in the guide
> today, but must to exist... is a suggestion to add information, a middle-expert
> or non-extert reader need it.

Uh, add data_directory where?  Which guide?

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

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


Re: please inform data_directory

От
Peter Krauss
Дата:
need this information, is like a  "pg_read_file Guide".


On Thu, Oct 11, 2018 at 3:51 PM Bruce Momjian <bruce@momjian.us> wrote:
On Thu, Oct 11, 2018 at 03:50:09PM -0300, Peter Krauss wrote:
> Hi, trying to explain again, 
> the "SHOW  data_directory"  is an information that not exist in the guide
> today, but must to exist... is a suggestion to add information, a middle-expert
> or non-extert reader need it.

Uh, add data_directory where?  Which guide?

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

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

Re: please inform data_directory

От
Bruce Momjian
Дата:
On Thu, Oct 11, 2018 at 03:56:42PM -0300, Peter Krauss wrote:
> 
> The page https://www.postgresql.org/docs/10/static/functions-admin.html
> need this information, is like a  "pg_read_file Guide".
> 
> 
> On Thu, Oct 11, 2018 at 3:51 PM Bruce Momjian <bruce@momjian.us> wrote:
> 
>     On Thu, Oct 11, 2018 at 03:50:09PM -0300, Peter Krauss wrote:
>     > Hi, trying to explain again, 
>     > the "SHOW  data_directory"  is an information that not exist in the guide
>     > today, but must to exist... is a suggestion to add information, a
>     middle-expert
>     > or non-extert reader need it.
> 
>     Uh, add data_directory where?  Which guide?

How is this patch adding a mention of the data_directory setting?

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

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

Вложения

Re: please inform data_directory

От
"David G. Johnston"
Дата:
On Thu, Oct 11, 2018 at 12:43 PM Peter Krauss <ppkrauss@gmail.com> wrote:
need this information, is like a  "pg_read_file Guide".

Applies to all:

"The functions shown in Table 9.88 provide native access to files on the machine hosting the server. Only files within the database cluster directory and the log_directory can be accessed. Use a relative path for files in the cluster directory, and a path matching the log_directory configuration setting for log files. Use of these functions is restricted to superusers except where stated otherwise."

Applies to pg_read_file:

"pg_read_file returns part of a text file, starting at the given offset, returning at most length bytes (less if the end of file is reached first). If offset is negative, it is relative to the end of the file. If offset and length are omitted, the entire file is returned. The bytes read from the file are interpreted as a string in the server encoding; an error is thrown if they are not valid in that encoding."

There is nothing unclear there and by the time one gets to this part of the documentation its reasonably assumed they understand "data directory"; being verbose on that point is not an improvement.  For the rare person that gets confused these lists are available to obtain clarity.  But aside from the one comment I've already made - and this is very minor in nature - I'm not seeing anything obvious short-comings here.

David J.