public inbox for [email protected]  
help / color / mirror / Atom feed
please inform data_directory
8+ messages / 5 participants
[nested] [flat]

* please inform data_directory
@ 2018-09-09 23:41  PG Doc comments form <[email protected]>
  0 siblings, 1 reply; 8+ messages in thread

From: PG Doc comments form @ 2018-09-09 23:41 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

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


^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: please inform data_directory
@ 2018-10-10 19:59  Bruce Momjian <[email protected]>
  parent: PG Doc comments form <[email protected]>
  0 siblings, 2 replies; 8+ messages in thread

From: Bruce Momjian @ 2018-10-10 19:59 UTC (permalink / raw)
  To: [email protected]; [email protected]

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  <[email protected]>        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 +




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: please inform data_directory
@ 2018-10-11 01:04  Michael Paquier <[email protected]>
  parent: Bruce Momjian <[email protected]>
  1 sibling, 0 replies; 8+ messages in thread

From: Michael Paquier @ 2018-10-11 01:04 UTC (permalink / raw)
  To: Bruce Momjian <[email protected]>; +Cc: [email protected]; [email protected]

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


Attachments:

  [application/pgp-signature] signature.asc (833B, 2-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: please inform data_directory
@ 2018-10-11 18:50  Peter Krauss <[email protected]>
  parent: Bruce Momjian <[email protected]>
  1 sibling, 1 reply; 8+ messages in thread

From: Peter Krauss @ 2018-10-11 18:50 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

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 <[email protected]> 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  <[email protected]>        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 +
>


^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: please inform data_directory
@ 2018-10-11 18:51  Bruce Momjian <[email protected]>
  parent: Peter Krauss <[email protected]>
  0 siblings, 1 reply; 8+ messages in thread

From: Bruce Momjian @ 2018-10-11 18:51 UTC (permalink / raw)
  To: Peter Krauss <[email protected]>; +Cc: [email protected]

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  <[email protected]>        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 +




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: please inform data_directory
@ 2018-10-11 18:56  Peter Krauss <[email protected]>
  parent: Bruce Momjian <[email protected]>
  0 siblings, 2 replies; 8+ messages in thread

From: Peter Krauss @ 2018-10-11 18:56 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

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 <[email protected]> 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  <[email protected]>        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 +
>


^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: please inform data_directory
@ 2018-10-11 19:24  Bruce Momjian <[email protected]>
  parent: Peter Krauss <[email protected]>
  1 sibling, 0 replies; 8+ messages in thread

From: Bruce Momjian @ 2018-10-11 19:24 UTC (permalink / raw)
  To: Peter Krauss <[email protected]>; +Cc: [email protected]

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 <[email protected]> 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  <[email protected]>        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:

  [text/x-diff] datadir.diff (1.3K, 2-datadir.diff)
  download | inline diff:
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
new file mode 100644
index 5193df3..0a5b30a
*** a/doc/src/sgml/func.sgml
--- b/doc/src/sgml/func.sgml
*************** postgres=# SELECT * FROM pg_walfile_name
*** 20297,20303 ****
      The functions shown in <xref
      linkend="functions-admin-genfile-table"/> provide native access to
      files on the machine hosting the server. Only files within the
!     database cluster directory and the <varname>log_directory</varname> can be
      accessed unless the user is granted the role
      <literal>pg_read_server_files</literal>.  Use a relative path for files in
      the cluster directory, and a path matching the <varname>log_directory</varname>
--- 20297,20305 ----
      The functions shown in <xref
      linkend="functions-admin-genfile-table"/> provide native access to
      files on the machine hosting the server. Only files within the
!     database cluster directory (see <link
!     linkend="guc-data-directory"><varname>data_directory</varname></link>)
!     and the <varname>log_directory</varname> can be
      accessed unless the user is granted the role
      <literal>pg_read_server_files</literal>.  Use a relative path for files in
      the cluster directory, and a path matching the <varname>log_directory</varname>


^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: please inform data_directory
@ 2018-10-11 19:51  David G. Johnston <[email protected]>
  parent: Peter Krauss <[email protected]>
  1 sibling, 0 replies; 8+ messages in thread

From: David G. Johnston @ 2018-10-11 19:51 UTC (permalink / raw)
  To: Peter Krauss <[email protected]>; +Cc: Bruce Momjian <[email protected]>; [email protected]

On Thu, Oct 11, 2018 at 12:43 PM Peter Krauss <[email protected]> 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.


^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2018-10-11 19:51 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-09-09 23:41 please inform data_directory PG Doc comments form <[email protected]>
2018-10-10 19:59 ` Bruce Momjian <[email protected]>
2018-10-11 01:04   ` Michael Paquier <[email protected]>
2018-10-11 18:50   ` Peter Krauss <[email protected]>
2018-10-11 18:51     ` Bruce Momjian <[email protected]>
2018-10-11 18:56       ` Peter Krauss <[email protected]>
2018-10-11 19:24         ` Bruce Momjian <[email protected]>
2018-10-11 19:51         ` David G. Johnston <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox