I am trying to create a new database and a schema in the new database using Sql script as below. The database is PostgreSql 14.1
DROP DATABASE IF EXISTS DEZDAZ;
CREATE DATABASE DEZDAZ
WITH
OWNER = postgres
ENCODING = 'UTF8'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;
\connect DEZDAZ;
CREATE SCHEMA DEZDAZ;
Keep getting below error:
DROP DATABASE
CREATE DATABASE
error: \connect: connection to server at "localhost" (::1), port 5432 failed: FATAL: database "DEZDAZ" does not exist
I have followed the answer below: PostgreSQL: Create schema in specific database
Thanks for your help.
\connect dezdaz. You did not doCREATE DATABASE "DEZDAZ"so the database name is folded to lower casedezdazper Identifiers Looks like\connectis doing"DEZDAZ"and not finding the upper case version of the name.