From 824b6ae31e72516544d5ab5a807e0179c26d15ba Mon Sep 17 00:00:00 2001 From: Dedekind561 Date: Thu, 18 Apr 2024 11:19:07 +0100 Subject: [PATCH] rm comments --- guides/db-setup/readme.md | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/guides/db-setup/readme.md b/guides/db-setup/readme.md index 5f08c40f09..58b46ce8d9 100644 --- a/guides/db-setup/readme.md +++ b/guides/db-setup/readme.md @@ -10,16 +10,15 @@ Use the `createdb` command to create a new database called `videorec`: createdb videorec ``` -### Initial Data Load +### Create tables and load data -Populate the database with initial data: +Create tables and load the database with initial data: ```bash psql -d videorec < db/initdb.sql ``` -
-Let's just parse that command clearly: +#### Summary 1. `psql` : Use the PostgreSQL command-line interface. 2. `-d` : This flag marks the next argument as the database name. @@ -27,23 +26,14 @@ psql -d videorec < db/initdb.sql 4. `<` : The following file will be used as input. 5. `db/initdb.sql` : The path to the SQL file to populate the database. -
- -
- - Depending how postgresql was installed for you, you might need to add some connectivity details to both createdb and psql: `psql -h localhost -U username -d videorec < db/initdb.sql` In this example you ask postgres to connect to your local database through localhost and use username as the user. ##### Check 📝 Double-check the command you just used was successful. What should you expect to see in your local database after running this command. - - ### Backup your database - - Now, let's create a compressed archive of your database for safekeeping. Use the `pg_dump` command with the following options: ```bash @@ -75,8 +65,6 @@ pg_dump -h localhost -U username videorec > backups/videorec_backup_$(date +"%Y- - This command incorporates the current date in the filename for easy identification and versioning. - - ### Removing, Re-initializing, and Restoring Now that we have a backup, let's practice removing and re-initializing the database: