121
votes
14answers
36k views
Repairing Postgresql after upgrading to OSX 10.7 Lion
I recently upgraded to OSX 10.7, at which point my rails installation completely borked when trying to connect to the psql server. When I do it from the command line using
psql -U postgres
it ...
58
votes
7answers
24k views
Unable to install pg gem on ubuntu - Can't find the 'libpq-fe.h header
I am using rails 3.1 pre version. I like to use PostgreSQL but the problem is installing the pg gem. It gives me the following error:
demonchand@system-001:~/exercise/personal/pro$ gem install pg
...
44
votes
6answers
6k views
Quickest way to find out heroku database size
What is the quickest way to find out the current size of my shared database in Heroku?
42
votes
11answers
25k views
How do you write a case insensitive query for both MySQL and Postgres?
I'm running a MySQL database locally for development, but deploying to Heroku which uses Postgres. Heroku handles almost everything, but my case-insensitive Like statements become case sensitive. I ...
37
votes
7answers
22k views
How to handle Ruby on Rails error: “Please install the postgresql adapter: `gem install activerecord-postgresql-adapter'”
Running a Ruby on Rails (RoR) app or Ruby code which uses the ActiveRecord framework, you get the error message:
Please install the postgresql adapter:
gem install
...
35
votes
7answers
12k views
Pros/Cons of MySQL vs Postgresql for production Ruby on Rails environment?
I will soon be switching from sqlite3 to either postgres or mysql. What should I consider when making this decision? Is mysql more suited for Rails than postgres in some areas and/or vice versa? Or, ...
32
votes
7answers
10k views
How to install gem pg on Ubuntu
When i try to install postgresSQL gem under Ruby.
i issued the following command:
gem install pg
since i am using Rails 3.0. i installed Ruby 1.9.2 by using RVM.
The above command shows me the ...
30
votes
4answers
11k views
Kill a postgresql session/connection
How can I kill all my postgresql connections?
I'm trying a rake db:drop but I get:
ERROR: database "database_name" is being accessed by other users
DETAIL: There are 1 other session(s) using the ...
28
votes
2answers
5k views
Creating a multi-tenant application using PostgreSQL's schemas and Rails
Stuff I've already figured out
I'm learning how to create a multi-tenant application in Rails that serves data from different schemas based on what domain or subdomain is used to view the ...
26
votes
8answers
8k views
How do you easily change from SQLite to PostgreSQL in Rails
I have a rails app that's databases are in SQLite (The dev and production). Since I am moving to heroku, I want to convert my database to PostgreSQL (I think that's how to spell it).
Anyways, I heard ...
23
votes
8answers
11k views
postgreSQL group by different from mysql?
I've been migrating some of my mySQL queries to postgreSQL to use Heroku... most of my queries work fine, but I keep having a similar recurring error when I use group by:
ERROR: column "XYZ" must ...
21
votes
8answers
7k views
Can't find the PostgreSQL client library (libpq)
I'm trying to install PostgreSQL for Rails on Mac OS X 10.6. First I tried the MacPorts install but that didn't go well so I did the one-click DMG install. That seemed to work.
I suspect I need to ...
20
votes
8answers
15k views
Can not connect to local PostgreSQL
I've managed to bork my local development environment.
All my local Rails apps are now giving the error:
PGError
could not connect to server: Permission denied
Is the server running locally and ...
20
votes
2answers
1k views
Optimise PostgreSQL for fast testing
I am switching to PostgreSQL from SQLite for a typical Rails application.
The problem is that running specs became slow with PG.
On SQLite it took ~34 seconds, on PG it's ~76 seconds which is more ...
19
votes
3answers
2k views
NOTICES for sequence after running migration in rails on postgresql Application
When i run my migration in Rails application on postgresql i got following NOTICES
NOTICE: CREATE TABLE will create implicit sequence "notification_settings_id_seq" for serial column ...