Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making PostgreSQL create directory for new tablespace

i would like to be able to do something like

CREATE TABLESPACE bob location 'C:\a\b\c\d\e\f\bob'

without needing to create all the directory tree beforehand. this is because i have java code that creates tablespaces on the fly and i would like to be able to run it on a separate machine (so it couldnt mkdir() or anything).

is there any sort of postgres configuration that would allow me to make postgres create the appropriate directory tree by itself?

like image 383
radai Avatar asked Jun 01 '26 14:06

radai


1 Answers

You could try do mkdir directly in postgres stored procedure using PL/sh or any of your favorite PL/* languages that are available for PostgreSQL

like image 100
Konstantin V. Salikhov Avatar answered Jun 04 '26 11:06

Konstantin V. Salikhov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!