Skip to content

Instantly share code, notes, and snippets.

@jobliz
Created June 22, 2018 19:08
Show Gist options
  • Save jobliz/439da26f67fe48494ffdffd86b275834 to your computer and use it in GitHub Desktop.
Save jobliz/439da26f67fe48494ffdffd86b275834 to your computer and use it in GitHub Desktop.

Revisions

  1. jobliz created this gist Jun 22, 2018.
    12 changes: 12 additions & 0 deletions posgresql_configuration_with_ltree.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    PostgreSQL database configuration with ltree extension
    ------------------------------------------------------

    1. Install PostgreSQL database (`apt install postgresql postgresql-contrib` under Ubuntu)
    2. Log in to the postgres account: `sudo --login --user postgres`
    3. Start the PostgreSQL interactive terminal: `psql`
    4. Create the database: `postgres=# CREATE DATABASE my_database;`
    5. Create a user: `postgres=# CREATE USER my_user WITH PASSWORD 'my_password';`
    6. Grant the user access to the database. `postgres=# GRANT ALL PRIVILEGES ON DATABASE my_database to my_user;`
    7. Switch to the database: `\connect my_database;`
    8. Enable ltree extension on the database: `create extension ltree;`
    9. Exit psql: `\q`