radai
radai

Reputation: 24192

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?

Upvotes: 3

Views: 2357

Answers (1)

Konstantin V. Salikhov
Konstantin V. Salikhov

Reputation: 4653

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

Upvotes: 1

Related Questions