Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create Postgres database containing dot in it's name?

Tags:

postgresql

I am trying to create the Postgres database using the terminal,

Normally we can create the database like

CREATE DATABASE mydatabase;

but I wanted to create with the database with a dot. like

CREATE DATABASE my.database;

I was trying to escape the characters. but it doesn't work

CREATE DATABASE my.\database;

CREATE DATABASE my\.database;

as an expected output, it should create the database named my.database

like image 402
OSMQuote Avatar asked Sep 07 '25 05:09

OSMQuote


1 Answers

you should create the database using

create database "my.database";

like image 135
Atul Arvind Avatar answered Sep 10 '25 16:09

Atul Arvind