Simurr
Simurr

Reputation: 702

Portable PostgreSQL for development off a usb drive

In order to take some development work home I have to be able to run a PostgreSQL database.

I don't want to install anything on the machine at home. Everything should run off the usb drive.

What development tools do you carry on your USB drive?

That question covers pretty much everything else, but I have yet to find a guide to getting postgresql portable. It doesn't seem easy if it's even possible.

So how do I get PostgreSQL portable? Is it even possible?

EDIT:

PostgreSQL Portable works. It's very slow on the usb-drive I have, but it works. I can't recommend doing constant development with it but for what I need it's great.

Perhaps if I pick up a full speed external drive I'll try out virtualization. Given the poor performance of just running the database off this drive, a full virtual OS running off of it would be unusable.

Upvotes: 21

Views: 32139

Answers (6)

RmccurdyDOTcom
RmccurdyDOTcom

Reputation: 172

I added Portable Postgres to my project. Let me know if you need anything/reports bugs etc! Thanks!

Java Android Magisk Burp Objection Root Emulator Easy (JAMBOREE)
https://github.com/freeload101/Java-Android-Magisk-Burp-Objection-Root-Emulator-Easy

Upvotes: 0

mrapi
mrapi

Reputation: 6015

1.download and extract : zip version

2.inside pgsql folder create data folder(put any name,I used 'data')

3.initalize data folder: c:\pgsql\bin\initdb.exe -D c:\pgsql\data -U postgres -W -E UTF8 -A scram-sha-256

4.to start/stop see next cmd code that I use (press any key inside it to stop)

c:\pgsql\bin\pg_ctl.exe -D c:\pgsql\data  -l logfile start
pause
c:\pgsql\bin\pg_ctl.exe -D c:\pgsql\data stop

more info

Upvotes: 4

user1592380
user1592380

Reputation: 36267

There are 2 projects to try in 2014: http://sourceforge.net/projects/pgsqlportable/ and http://sourceforge.net/projects/postgresqlportable/?source=recommended.

I can't vouch for the second, but I'm using the first and it works right out of the box.

After unzipping using 7-zip (http://www.7-zip.org/download.html):

1) Run "start service without usuario.bat" ( english translation )
2) Then run "pgadmin3.bat"

The only minimal problem for me was that its in spanish. I've been able to change the language to english by following Change language of system and error messages in PostgreSQL. Using google translate the instructions are:

Description

This is a zip to automatically run postgresql 9.1.0.1 for windows. This version already has pgagent and pldebugger. To run must: 1) unzip the zip 2) run the "start service without usuario.bat" found in the pgsql directory within the folder you just unzipped. 3) Optional. If you want to run the agent works postgresql (pgagent) should only run the "start pgagent.bat" found in the pgsql directory inside the folder you just unzipped. 4) Optional. To manage and / or develop the bd you can run the pgadmin3.bat 5 files) Optional. To stop and / or restart the server correctly use file "service without stopping usuario.bat" usuario.bat or restart service without depending on the case.

Now option for Linux (file. Tar.gz). Postgresql portable Linux 9.2    

Please use the tickets for your answer bugs.    

Username: postgres Password: 123

Just a Note : on a new computer , to get pgadminIII working you may need to add a db. The settings are in attached screenshot.

Hope it helps.

enter image description here

Upvotes: 3

Jhonny D. Cano -Leftware-
Jhonny D. Cano -Leftware-

Reputation: 18013

I agree with virtualization solution, but maybe you can find useful this link from portable freeware collection, I have used this locally, not from usb though

Upvotes: 1

Alex Beardsley
Alex Beardsley

Reputation: 21173

An alternate route would be to use something like VirtualBox and just install your development environment (database, whatever) on there.

Upvotes: 6

Related Questions