Portable PostgreSQL for development off a usb drive

26,909

Solution 1

Here's how you can do this on your own: http://www.postgresonline.com/journal/archives/172-Starting-PostgreSQL-in-windows-without-install.html

Solution 2

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

Solution 3

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

Solution 4

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

Share:
26,909

Related videos on Youtube

Simurr
Author by

Simurr

Updated on July 05, 2022

Comments

  • Simurr
    Simurr almost 2 years

    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.

    • Cyberknight
      Cyberknight almost 6 years
      First, I know this question is pretty old (although last edit was last year). Anyway, I just wanted to add that you shouldn't keep the database file in the USB Flash memory while running PostgreSQL, and that's not due to performance issues, but because that will eventually burn out the memory. USB Flash Memories have an intrinsic limit of how many times each physical memory block can be rewritten. To make it last longer, copy (don't move, as moving causes writing) the DB file to HDD, run Postgre and, when done, move/copy back DB file to USB. Also, better keep DB encrypted when on the HDD.