Note
This help is specific to Postgres. You may need to adjust steps if you are using a different database server.
Are you stuck and Copilot's not helping? Here's a hint to get you started.
-
Connect to your database server and select
postgres
as the database. -
Once connected open a new SQL file in your editor.
-
Use Copilot to generate the SQL command to create a new database.
-- create a database called copilotlab
You should find that Copilot will respond with something like:
CREATE DATABASE copilotlab;
If Copilot isn't responding, clear your SQL editor and try again.
-
You also need to grant your user access to the new database. Use Copilot to generate the SQL command to grant access to the new database.
-- grant user myuser access to the database
You should find that Copilot will respond with something like:
GRANT ALL PRIVILEGES ON DATABASE copilotlab TO myuser;
Note: replace myuser
with your username.
Once you have created this new database you should update your connection settings to use this new database and reconnect.
You can check which database you are connected to by running the following SQL command:
SELECT current_database();