Skip to content

Latest commit

 

History

History
79 lines (77 loc) · 2.01 KB

File metadata and controls

79 lines (77 loc) · 2.01 KB

ERP-system

Setting up Postgres

  1. First, pull the docker image of postgres15

    PS> docker pull postgres:15-alpine
  2. Then use the makefile

    1. To Initialize the image for local
       PS> make postgresinit
    2. To open the console (psql)
       PS> make postgres
    3. To Create the db for users
       PS> make createdbusers
    4. To drop the users db
       PS> make dropdbusers
    5. To open the console (bash)
       PS> make bash
  3. For using the psql

    1. To see all the databases
       root=# \l
    2. connect to the db wanted
       root=# \c <yourdb>
    3. to see all the relations or tables
       root=# \dt
    4. to see all values in the table
       root=# SELECT * FROM <tablename>;
    5. to quit
       root=# \q

For any problems while using Postgres

  1. If it says SSL Enabled error
    1. Then Use bash:
      PS> make bash
    2. go to postgres.conf file
      f92622037df6:/# cd /var/lib/postgresql/data
    3. check the SSL setting
      f92622037df6:/# cat postgresql.conf | grep ssl
      If it is not this in the first line.
      Image Description
    4. Uncomment the line: # ssl = off
      f92622037df6:/# vi postgresql.conf
      use only vi, as it is the only one that is supported.
    5. Then demote yourself as a normal user and restart the postgres service:
      f92622037df6:/# su - postgres
      f92622037df6:~$ pg_ctl restart
    6. If the image has stopped running, then run the image from Docker Desktop.
    7. Then try to use the service again. It should work.