Madra David
Madra David

Reputation: 151

Why doesn't psycopg2 respect case?

In posgtresql (atleast on ubuntu server) if i create database like

CREATE DATABASE azREydayz;

And then add the same database name in django settings

DATABASES = {
  'ENGINE': 'postgresql_psycopg2',
  'NAME': 'azREydayz', 
}

i get an error saying

django.db.utils.OperationalError: FATAL:  database "azREydayz" does not exist

.To solve this i change the 'NAME': 'azREydayz', to 'NAME': 'azreydayz', . My question is why doesn't psycopg2 respect case ?

Upvotes: 1

Views: 314

Answers (1)

sk1p
sk1p

Reputation: 6735

I guess this is because database names are only case sensitive when quoted, so if you did CREATE DATABASE "azREydayz"; it would have respected the case.

Upvotes: 3

Related Questions