pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Maksim Milyutin <milyutinma@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Hint to set owner for tablespace directory
Date: Mon, 24 Sep 2018 14:50:12 +0200
Message-ID: <542444d9-d768-aa10-07c1-83abd896e86f@2ndquadrant.com> (raw)
In-Reply-To: <8aa308d4-347a-52a3-0294-f0672b091a7e@2ndquadrant.com>
References: <5ca60e1a-26f9-89fd-e912-021dd2b8afe2@gmail.com>
	<1bc2bc14-e42a-8d9c-d47c-3afac05de347@2ndquadrant.com>
	<2615ea98-6537-1fcf-667a-09022063336a@postgrespro.ru>
	<17440.1535723980@sss.pgh.pa.us>
	<c0b574a8-1a8f-2e74-981c-f4206b0e385a@gmail.com>
	<b1a2ea3c-9472-2ca3-a5ab-ada7215a0d65@2ndquadrant.com>
	<91828914-cfa2-b186-01e3-68a39a77f497@gmail.com>
	<8aa308d4-347a-52a3-0294-f0672b091a7e@2ndquadrant.com>

On 11/09/2018 17:10, Peter Eisentraut wrote:
> On 07/09/2018 17:59, Maksim Milyutin wrote:
>> those directories was that user). The error message "could not set 
>> permissions on directory ..." disoriented that user. The need to change 
>> the owner of those directories came after careful reading of 
>> documentation. I think it would be helpful to show the proposed hint to 
>> more operatively resolve the problem.
> 
> I think it might be worth clarifying the documentation instead.  I'm
> looking at the CREATE TABLESPACE reference page and it's not super clear
> on first reading.

How about the attached patch?

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

Attachments:

0001-doc-Clarify-CREATE-TABLESPACE-documentation.patch (text/plain, 2.1K) download From eb0796921b6ebfe2375037d903a081a7b8f45c0b Mon Sep 17 00:00:00 2001 From: Peter Eisentraut <peter_e@gmx.net> Date: Mon, 24 Sep 2018 14:47:09 +0200 Subject: [PATCH] doc: Clarify CREATE TABLESPACE documentation Be more specific about when and how to create the directory and what permissions it should have. --- doc/src/sgml/ref/create_tablespace.sgml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/doc/src/sgml/ref/create_tablespace.sgml b/doc/src/sgml/ref/create_tablespace.sgml index 18fa5f0ebf..c621ec2c6b 100644 --- a/doc/src/sgml/ref/create_tablespace.sgml +++ b/doc/src/sgml/ref/create_tablespace.sgml @@ -92,7 +92,8 @@ <title>Parameters</title> <listitem> <para> The directory that will be used for the tablespace. The directory - should be empty and must be owned by the + must exist (<command>CREATE TABLESPACE</command> will not create it), + should be empty, and must be owned by the <productname>PostgreSQL</productname> system user. The directory must be specified by an absolute path name. </para> @@ -137,15 +138,23 @@ <title>Notes</title> <title>Examples</title> <para> - Create a tablespace <literal>dbspace</literal> at <literal>/data/dbs</literal>: + To create a tablespace <literal>dbspace</literal> at file system location + <literal>/data/dbs</literal>, first create the directory using operating + system facilities and set the correct ownership: +<programlisting> +mkdir /data/dbs +chown postgres:postgres /data/dbs +</programlisting> + Then issue the tablespace creation command inside + <productname>PostgreSQL</productname>: <programlisting> CREATE TABLESPACE dbspace LOCATION '/data/dbs'; </programlisting> </para> <para> - Create a tablespace <literal>indexspace</literal> at <literal>/data/indexes</literal> - owned by user <literal>genevieve</literal>: + To create a tablespace owned by a different database user, use a command + like this: <programlisting> CREATE TABLESPACE indexspace OWNER genevieve LOCATION '/data/indexes'; </programlisting></para> -- 2.19.0

view thread (19+ messages)  latest in thread

Message-ID: <542444d9-d768-aa10-07c1-83abd896e86f@2ndquadrant.com>
Permalink:  ../542444d9-d768-aa10-07c1-83abd896e86f@2ndquadrant.com/
Also on:    postgresql.org/message-id/542444d9-d768-aa10-07c1-83abd896e86f@2ndquadrant.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: peter.eisentraut@2ndquadrant.com, milyutinma@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: Hint to set owner for tablespace directory
  In-Reply-To: <542444d9-d768-aa10-07c1-83abd896e86f@2ndquadrant.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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