please inform data_directory

Started by PG Bug reporting formover 7 years ago8 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

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

#2Bruce Momjian
bruce@momjian.us
In reply to: PG Bug reporting form (#1)
Re: please inform data_directory

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 +
#3Michael Paquier
michael@paquier.xyz
In reply to: Bruce Momjian (#2)
Re: please inform data_directory

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

#4Peter Krauss
ppkrauss@gmail.com
In reply to: Bruce Momjian (#2)
Re: please inform data_directory

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:

Show quoted text

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 +
#5Bruce Momjian
bruce@momjian.us
In reply to: Peter Krauss (#4)
Re: please inform data_directory

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 +
#6Peter Krauss
ppkrauss@gmail.com
In reply to: Bruce Momjian (#5)
Re: please inform data_directory

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:

Show quoted text

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 +
#7Bruce Momjian
bruce@momjian.us
In reply to: Peter Krauss (#6)
Re: please inform data_directory

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 +

Attachments:

datadir.difftext/x-diff; charset=us-asciiDownload+4-4
#8David G. Johnston
david.g.johnston@gmail.com
In reply to: Peter Krauss (#6)
Re: please inform data_directory

On Thu, Oct 11, 2018 at 12:43 PM Peter Krauss <ppkrauss@gmail.com> wrote:

The page https://www.postgresql.org/docs/10/static/functions-admin.html
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.