Tablespaces in PGO 5

127 views
Skip to first unread message

Marc Olivé

unread,
Dec 1, 2021, 12:09:47 PM12/1/21
to Postgres Operator
Hello experts!

Is there a way to add tablespaces in PGO 5? I'm not able to find any mention in the CRD reference.

I've found tablespace support in PGO's 4 documentation though.

Thanks,
--
Marc Olivé

Jonathan S. Katz

unread,
Dec 1, 2021, 12:10:13 PM12/1/21
to Marc Olivé, Postgres Operator
Why are you looking to add a tablespace?

Jonathan S. Katz
VP Platform Engineering

Crunchy Data
Enterprise PostgreSQL 


Marc Olivé

unread,
Dec 2, 2021, 8:10:49 AM12/2/21
to Postgres Operator
Because we have some big partitioned tables and having HD space troubles, and we are planning to add big, cheaper Mb/€, HDs to archive old, rarely accessed data to them.

Regards,
--
Marc Olivé

Jonathan S. Katz

unread,
Dec 2, 2021, 2:49:02 PM12/2/21
to Marc Olivé, Postgres Operator
It's probably a better idea to put that data into separate Postgres instances vs. using tablespaces.

Even if you're using cheaper disks for the tablespaces, Postgres considers them all as part of the same cluster. So, for example, if one of the tablespace volumes becomes unavailable or runs out of space, Postgres will stop and your cluster is down.

Instead, you can put the data on a separate instance completely that uses the cheaper disks. If you need to access it within your main cluster, you could use the postgres_fdw (e.g. https://blog.crunchydata.com/blog/postgresql-14-on-kubernetes)

Thanks,

Jonathan

Marc Olivé

unread,
Dec 3, 2021, 10:11:54 AM12/3/21
to Postgres Operator
Yeah, we are also considering using a separate server with FDW, just wondering if a more traditional approach using tablespaces was also possible.

PGO 4 seems to have some support for tablespaces, is it planned to add them in PGO 5? If not, why? Just to know out of curiosity.

Thanks and regards,
--
Marc Olivé

Ben

unread,
Feb 22, 2022, 7:08:50 AM2/22/22
to Postgres Operator, Marc Olivé
Hi,

sorry for the hijack but I posted a related question on the repo https://github.com/CrunchyData/postgres-operator/issues/3044 and I would also be interested to know more about this.
In my case the storage system I have access to has a limit of IOPS per volume. I would like to use tablespaces to move hot tables to separate volume for them to enjoy their own IO quotas.
Outside the specific tablespace feature, I think letting people mount additional volumes on the database container could be a viable solution for custom extensions too.

Best Regards,
Ben

TJ Moore

unread,
Sep 27, 2022, 3:40:15 PM9/27/22
to Postgres Operator, Ben, Marc Olivé
Hello Ben,

Thank you for your use case details. As mentioned on the referenced Github issue, I've added them to our feature backlog.

Regards,

TJ

Ben Blattberg

unread,
Feb 24, 2023, 5:06:00 PM2/24/23
to Postgres Operator, Ben, Marc Olivé
Hello, 

Just wanted to update this thread: support for tablespaces has been added in this PR.

A few things to note:
(a) The feature is alpha and behind a feature gate, which is discussed in the docs. I hope the docs are clear, but if you have any questions, please ask.

(b) The code is in the repo, but not yet in our latest image for the operator, which is coming, but I'm not sure when.


drew.s...@crunchydata.com

unread,
Jul 27, 2023, 9:17:05 PM7/27/23
to Postgres Operator, Ben Blattberg, Ben, Marc Olivé
Hello,

Just following up on this thread to say that we have released CPK 5.4.0 which includes support for Tablespaces.

Regards,
Drew
Reply all
Reply to author
Forward
0 new messages