![]() To pull a live database from Heroku, export it using pgbackups, then import using pg_restore If you'd rather use a GUI, that's fine, Use the GUI to create your database and skip to the next part. Assuming you've got everything set up corectly, you should be able to go to a terminal and type: You might refer to this stack overflow post. ![]() Gem install pg – –with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config Your installation will likely look like this: If you've used the Postgres.app, and I suggest you do, the pg_config will be inside the Postgres.app directory. Gem install pg Installing the pg gem with Postgres.app If you've used brew, this file will be at the default location. The pg gem needs to know the location of a file called pg_config. Next you'll need the pg gem to let Ruby talk to Postgres. If you wish, you can also install postgres from homebrew.įollow the instructions to start the server on login. You'll probably also want to include the command line tools: This is a stand-alone app which contains everything you need to run Postgres. The easiest way to do this is with the postgres app. Installation Via the Postgres.appįirst up you need to install postgres. You are a Rails developer, possibly a very good one, who is using postgres to les than it's full potential. ![]() This little book is your guide to PostGres with Rails. Version around.Since MySQL was bought by Oracle, PostGres has become the de-facto SQL database for Rails. Makes no attempt to migrate existing databases to the new version!įortunately, this time brew was at least kind enough to keep the old Restart the service instead of leaving the old background one in Upgrade from 9.6.2 to 10.4 without saying anything! I just tried installing pg_top, a utility that lets you view activeĬonnections to your database. What’s the worst that could happen? Update - Brew does it again! Maybe now would be a good time to upgrade to Sierra. ![]() That twelve character bug fix worked! I’m off to my next coding adventure. Thanks Peter! And four hours day later on a monday afternoon I should have either had backups, or been able to work from clean databases without affecting my productivity. Not having a set up where it wasn’t a problem to blow away my dev dbs and start from scratch. And annoyed at myself.įor not properly investigating the broken readline stuff I’d been dealing with off and on for a bit and ‘fixed’ by rebuilding my rubies in rvm. It would be nice if there was some sort of -force or Are you sure?(Y/N) prompt for these more disruptive upgrades, and wish the 9.3 version of postgres would have floated around a bit more so I could have fixed the problem without resorting to third-party taps. I’m sure the developers have their reasons and if I was on top of things it would make sense, but it’s frustrating to find four alternate solutions on StackOverflow that should magically fix your problem only to be told politely by brew, “Sorry, that command just doesn’t work anymore. It’s inexplicable (to me) deprecations of vast swaths of homebrew commands. Even though I tracked down the commit for 9.3, we now seem to autoupgrade and always install 9.6.2. It seems to have broken old ways of installing old software by checking out an old commit of a particular brew file. It allows no way out-of-the-box at this point for me to install the 9.3 binaries to do the upgrade from 9.3 to 9.4. It makes no attempt to warn me that upgrading from 9.3 requires some serious manual intervention, the second time it’s silently updated a version of software to a version that’s incompatible with everything I have installed. I actually thought this blew up when I did an OS upgrade to OSX. It silently upgraded readline which introduced a bunch of errors to old versions of software. Pg_ctl -D /usr/local/var/postgres.old/ stopīrew unlink link -f little annoyed at brew right now.īrew has given more than enough I can’t be too mad at it for too long, but I’m a little disappointed that: Pg_ctl -D /usr/local/var/postgres.old/ -l /usr/local/var/postgres/server.log start If you do need the postgis enabled databases, the documentation for the tap indicates that you can use a utility called pex to install things, but I didn’t bother figuring that out.īrew unlink link -f Need to start manually beacuse the files aren't where we expect Unfortunately I don’t have a fix for that, but can tell you how to at least delete the offending databases if you don’t care about them, like I didn’t. Attempts to get postgis to install on the 9.3 version of postgres failed. I had two old databases that used PostGIS. # Drink a coffee (or beer) or three or six while there's a migration Pg_upgrade -b -B /usr/local/Cellar/postgresql/9.6.2/bin/ -d /usr/local/var/postgres.old/ -D /usr/local/var/postgres # may need to look in to /usr/local/Cellar to get exact directories Mv /usr/local/var/postgres/ /usr/local/var/postgres.old
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |