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:
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:
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With