Skip to content

Instantly share code, notes, and snippets.

@ppa-odoo
Last active January 30, 2023 06:57
Show Gist options
  • Save ppa-odoo/7ee7b7220c6e541be88d4d94e0f5e744 to your computer and use it in GitHub Desktop.
Save ppa-odoo/7ee7b7220c6e541be88d4d94e0f5e744 to your computer and use it in GitHub Desktop.

Revisions

  1. Prashant revised this gist Aug 9, 2019. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install configuration Postgres
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,7 @@
    https://help.ubuntu.com/community/PostgreSQL
    http://stackoverflow.com/questions/24917832/how-connect-postgres-to-localhost-server-using-pgadmin-on-ubuntu
    Postgres
    https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-18-04

    sudo apt update
    sudo apt install postgresql postgresql-contrib
  2. Prashant revised this gist Aug 9, 2019. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions install configuration Postgres
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,11 @@

    https://help.ubuntu.com/community/PostgreSQL
    http://stackoverflow.com/questions/24917832/how-connect-postgres-to-localhost-server-using-pgadmin-on-ubuntu
    Postgres

    sudo apt update
    sudo apt install postgresql postgresql-contrib

    sudo su postgres -c psql

    create user username with password 'password';
  3. Prashant Panchal revised this gist May 11, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions install configuration Postgres
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    https://help.ubuntu.com/community/PostgreSQL
    http://stackoverflow.com/questions/24917832/how-connect-postgres-to-localhost-server-using-pgadmin-on-ubuntu
    Postgres

    sudo su postgres -c psql
  4. Prashant Panchal created this gist May 11, 2016.
    37 changes: 37 additions & 0 deletions install configuration Postgres
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    Postgres

    sudo su postgres -c psql

    create user username with password 'password';

    alter user username superuser;


    I came across your question when looking for the same answer. I attempted to follow the instructions @prasad.surase gave you. The problem I found is the ppa repository is going to depreciate soon on 12.04 LTS. Instead I found this link and it really helped.

    PostgreSQL setup for Rails development in Ubuntu 12.04


    Install postgresql and admin tools through the package manager
    >sudo apt-get install postgresql libpq-dev phppgadmin pgadmin3

    Login to postgresql prompt as the postgres user
    >sudo su postgres -c psql

    Create a postgresql user for your project
    >create user username with password 'password';

    Setup your postgres user with the same name and password as your Ubuntu user and make him a postgres superuser
    >alter user username superuser;

    Create the development and test databases
    >create database projectname_development;
    >create database projectname_test;

    Give permissions to the user on the databases
    >grant all privileges on database projectname_development to username;
    >grant all privileges on database projectname_test to username;

    To end the postgresql session type \q
    Update password for the user
    >alter user username with password ‘new password’;