Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

database "public" does not exist - postgres/sequelize

I'm trying to connect postgres database from sequelize (node.js).But sequelize throws error like ERROR: database "public" does not exist.

The database url is given below:

postgres://postgres:root@localhost:5432/public

The show db result is given below: enter image description here

I have modified the database url as follows: postgres://postgres:root@localhost:5432/postgres, where postgres is valid database.Please find the attached image below:

enter image description here

like image 606
Prem Avatar asked Oct 16 '25 13:10

Prem


1 Answers

database and schema in postgresql are not the same object .. you should provide the database name not the schema name

you could get the list of the database using

psql -U pgadmin -l
like image 72
ScaisEdge Avatar answered Oct 19 '25 03:10

ScaisEdge