PG::InvalidParameterValue: ERROR: invalid value for parameter “client_min_messages”: “panic”

To make it work with PostgreSQL version 12, I monkey patched PostgreSQLAdapter class to replace ‘panic’ with ‘warning’ message. Note, if you can upgrade activerecord gem to 4.2.6 or higher versions you don’t need to have this monkey patch. I had to do this because my project depends on gem activerecord-3.2.22.5 require ‘active_record/connection_adapters/postgresql_adapter’ class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter … Read more

How to recreate a deleted table with Django Migrations?

In django 1.7 you can try: 1. Delete your migrations folder 2. In the database: DELETE FROM django_migrations WHERE app = ‘app_name’. You could alternatively just truncate this table. 3. python manage.py makemigrations 4. python manage.py migrate –fake If you are working in django 1.9.5 this is the 100 % solution for this problem: 1. … Read more

PostgreSQL error: could not connect to database template1: could not connect to server: No such file or directory

The error means that the Postgres server is not running. Try starting it: sudo systemctl start postgresql I believe the service name is postgresql, but if that doesn’t work, try typing sudo systemctl start postgres and pressing tab to auto-complete. Make sure that the server starts on boot: sudo systemctl enable postgresql