pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
SubTablespaces(Recursive) expected behaviour?
6+ messages / 3 participants
[nested] [flat]

* SubTablespaces(Recursive) expected behaviour?
@ 2024-07-28 15:27  Stepan Neretin <sncfmgg@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Stepan Neretin @ 2024-07-28 15:27 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

Hi, please tell me what is the expected behavior if I create a tablespace
tbl1 in /data, and then create a tablespace tbl2 in /data/tbl2 There is
nothing written in the documentation about this. Will the behavior of tbl2
change somehow?

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

* Re: SubTablespaces(Recursive) expected behaviour?
@ 2024-07-28 15:47  David G. Johnston <david.g.johnston@gmail.com>
  parent: Stepan Neretin <sncfmgg@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: David G. Johnston @ 2024-07-28 15:47 UTC (permalink / raw)
  To: Stepan Neretin <sncfmgg@gmail.com>; +Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

On Sunday, July 28, 2024, Stepan Neretin <sncfmgg@gmail.com> wrote:

> Hi, please tell me what is the expected behavior if I create a tablespace
> tbl1 in /data, and then create a tablespace tbl2 in /data/tbl2 There is
> nothing written in the documentation about this. Will the behavior of
> tbl2 change somehow?
>

https://www.postgresql.org/docs/current/manage-ag-tablespaces.html

David J.

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

* Re: SubTablespaces(Recursive) expected behaviour?
@ 2024-07-28 15:54  Stepan Neretin <sncfmgg@gmail.com>
  parent: David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Stepan Neretin @ 2024-07-28 15:54 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

On Sun, Jul 28, 2024 at 10:47 PM David G. Johnston <
david.g.johnston@gmail.com> wrote:

> On Sunday, July 28, 2024, Stepan Neretin <sncfmgg@gmail.com> wrote:
>
>> Hi, please tell me what is the expected behavior if I create a tablespace
>> tbl1 in /data, and then create a tablespace tbl2 in /data/tbl2 There is
>> nothing written in the documentation about this. Will the behavior of
>> tbl2 change somehow?
>>
>
> https://www.postgresql.org/docs/current/manage-ag-tablespaces.html
>
> David J.
>

Hi, David. I have read this page several times and have not answered my
question. I'm probably not paying attention. Can you, I wanted to quote
what I'm missing out on? Best Regards, Stepan Neretin!

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

* Re: SubTablespaces(Recursive) expected behaviour?
@ 2024-07-28 16:05  David G. Johnston <david.g.johnston@gmail.com>
  parent: Stepan Neretin <sncfmgg@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: David G. Johnston @ 2024-07-28 16:05 UTC (permalink / raw)
  To: Stepan Neretin <sncfmgg@gmail.com>; +Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

On Sunday, July 28, 2024, Stepan Neretin <sncfmgg@gmail.com> wrote:
>
> On Sun, Jul 28, 2024 at 10:47 PM David G. Johnston <
> david.g.johnston@gmail.com> wrote:
>
>> On Sunday, July 28, 2024, Stepan Neretin <sncfmgg@gmail.com> wrote:
>>
>>> Hi, please tell me what is the expected behavior if I create a
>>> tablespace tbl1 in /data, and then create a tablespace tbl2 in /data/
>>> tbl2 There is nothing written in the documentation about this. Will the
>>> behavior of tbl2 change somehow?
>>>
>>
>> https://www.postgresql.org/docs/current/manage-ag-tablespaces.html
>>
>> Hi, David. I have read this page several times and have not answered my
> question. I'm probably not paying attention. Can you, I wanted to quote
> what I'm missing out on
>

 “The location must be an existing, empty directory that is owned by the
PostgreSQL operating system user.”

David J.

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

* Re: SubTablespaces(Recursive) expected behaviour?
@ 2024-07-28 16:10  Tom Lane <tgl@sss.pgh.pa.us>
  parent: David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Tom Lane @ 2024-07-28 16:10 UTC (permalink / raw)
  To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: Stepan Neretin <sncfmgg@gmail.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Sunday, July 28, 2024, Stepan Neretin <sncfmgg@gmail.com> wrote:
>> Hi, David. I have read this page several times and have not answered my
>> question. I'm probably not paying attention. Can you, I wanted to quote
>> what I'm missing out on

>  “The location must be an existing, empty directory that is owned by the
> PostgreSQL operating system user.”

Indeed, that doesn't directly answer the question, but I think the
implication is clear: we do not expect a tablespace directory to
contain anything except files that Postgres itself puts there.

I don't actually see the point of the described setup anyway.  There
is zero value that I can see in putting two tablespaces on the same
physical volume --- they won't provide any interesting separation.

			regards, tom lane





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

* Re: SubTablespaces(Recursive) expected behaviour?
@ 2024-07-28 16:32  David G. Johnston <david.g.johnston@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: David G. Johnston @ 2024-07-28 16:32 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Stepan Neretin <sncfmgg@gmail.com>; pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>

On Sunday, July 28, 2024, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> "David G. Johnston" <david.g.johnston@gmail.com> writes:
> > On Sunday, July 28, 2024, Stepan Neretin <sncfmgg@gmail.com> wrote:
> >> Hi, David. I have read this page several times and have not answered my
> >> question. I'm probably not paying attention. Can you, I wanted to quote
> >> what I'm missing out on
>
> >  “The location must be an existing, empty directory that is owned by the
> > PostgreSQL operating system user.”
>
> Indeed, that doesn't directly answer the question, but I think the
> implication is clear: we do not expect a tablespace directory to
> contain anything except files that Postgres itself puts there.


Ok, so the flow is:
Mkdir data
Create tablespace data
Mkdir data/tbl2
Create tablespace /data/tbl2

Both creates meet the preconditions, and while creating unrelated files
within an existing tablespace directory is frowned upon and risky it isn’t
something that is going to guarantee failure or can be prohibited.

Just bite the bullet and move the first tablespace to a better location, or
leave things as is since, assuming /data/tbl2 is on the same filesystem as
/data, the second tablespace isn’t isolated anyway, as Tom said.

David J.

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


end of thread, other threads:[~2024-07-28 16:32 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-07-28 15:27 SubTablespaces(Recursive) expected behaviour? Stepan Neretin <sncfmgg@gmail.com>
2024-07-28 15:47 ` David G. Johnston <david.g.johnston@gmail.com>
2024-07-28 15:54   ` Stepan Neretin <sncfmgg@gmail.com>
2024-07-28 16:05     ` David G. Johnston <david.g.johnston@gmail.com>
2024-07-28 16:10       ` Tom Lane <tgl@sss.pgh.pa.us>
2024-07-28 16:32         ` David G. Johnston <david.g.johnston@gmail.com>

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