DEV Community

Linh Truong Cong Hong
Linh Truong Cong Hong

Posted on

1

"use database_name" with PostgreSQL

I want to write a SQL file that when we run the SQL Script, it will create the database with its tables and insert values into those tables.

However, with PostgreSQL, it is impossible to use the systax "use database_name" after creating the database. Therefore, it is impossible for me to switch the database and start creating table.

Is there any way to solve this problem? Why PostgreSQL development team decide to eliminate this function from this interesting ORDBMS?

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay