PG::Error (FATAL: too many connections for role "xxxxxxx") image
PG::Error (FATAL: too many connections for role "xxxxxxx")

PostgreSQL could be configured to limit number of simultaneous connections to the database. The heroku comes with plans having connection limits. The 'Hobby' plans comes with 20 connections where as …

read more
Create a database, create a user and grant privileges in PostgreSQL Database image
Create a database, create a user and grant privileges in PostgreSQL Database

To create a database, create a user and grant privileges to the user on command line is often a requirement only when a new project is initialized. The process is …

read more
Concatenate two columns in results of SQL query in PostgreSQL image
Concatenate two columns in results of SQL query in PostgreSQL

Very often, you will have the requirement to concatenate two columns in a table, on the fly in SQL. For example, first name and last name needed to be combined …

read more
Django - check for null in database image
Django - check for null in database

In django, the NULL valuein the database field is tested with field lookup It takes eitheror, which correspond to SQL queries ofand, respectively. Example: SQL equivalent:

read more
Search database with regular expression in Django image
Search database with regular expression in Django

Regex and iregex are the two field lookups that enable us to search database with regular expressions. regex is case-sensitive where as iregexis case-insensitive. The regular expression syntax is that …

read more