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.