I need to be able to run PostgreSQL databases outside the standard installation directories, ie run the existing postgres
or pg_ctl
process pointing to the alternative ports, configuration and data directories and get it running, with permissions etc working okay.
I don't want it to depend on the existing package based installation setup's structures in /etc/postgresql
and /var/run/postgresql
and the postgres
user, but use their executables if possible.
I will not be using initdb
much. The data will be unzipped from other installations. The only thing required is database compatibility with the existing package based installations, which I may be able to install if they are absent. Using executables of my own will be the last resort, due to the possibility of unexpected local dependencies.
Windows appears well covered in that respect with some downloads at EnterpriseDB but there doesn't seem so much available for Linux.
-
Why would you do this?András Váczi– András Váczi2013年11月01日 14:25:41 +00:00Commented Nov 1, 2013 at 14:25
-
To setup development and testing environments quickly without affecting the existing setup and also installing customized packagesvfclists– vfclists2013年11月01日 14:56:24 +00:00Commented Nov 1, 2013 at 14:56
-
How about setting up some virtual machines? For example, we have a VirtualBox image available for every dev, with PostgreSQL installed from packages (which are basically the standard ones). This way I have about 7 instances, only one locally and the others virtualized. When I kill one of these (as it happened already due to pg_xlog diskspace problems), I just reimport the image and that it is.András Váczi– András Váczi2013年11月01日 16:58:47 +00:00Commented Nov 1, 2013 at 16:58
-
@dezso It isn't for development alone. It is for the ability to put bundle executables and all related for an application into a single directory for easy management. I have used VMs and they do tend to proliferatevfclists– vfclists2013年11月01日 23:05:58 +00:00Commented Nov 1, 2013 at 23:05
-
At enterprisedb.com/products-services-training/pgbindownload there are ZIP distributions for Linux as well.user1822– user18222013年11月07日 07:16:57 +00:00Commented Nov 7, 2013 at 7:16
1 Answer 1
pg_ctl allows for a -D
option which allows you to point at your data wherever it is.
I do this all the time for development environments and fun things like setting up intracomputer replication environments for testing. It works fine.
The one thing you really need to be careful about is the configuration. After unzipping you should probably edit the postgresql.conf
appropriately.
-
Is that the postgresql.conf the standard packages install at /etc/postgresql? I don't want to involve that one.vfclists– vfclists2013年11月10日 18:44:17 +00:00Commented Nov 10, 2013 at 18:44
-
I believe debian and ubuntu put the file in /etc/postgresql/[version]/[cluster]/ so you should have multiple postgresql.conf files in /etc.Chris Travers– Chris Travers2013年11月11日 02:23:59 +00:00Commented Nov 11, 2013 at 2:23
Explore related questions
See similar questions with these tags.