I followed the installation on this document http://www.postgresql.org/download/linux/ubuntu/ and every thing seems to be fine. But when I try to this follow this tutorial: http://www.postgresql.org/docs/9.3/static/tutorial-createdb.html, everything is not fine any more. This is the error I got when I try to create a database table:
$ createdb mydb
WARNING: password file "/home/.../.pgpass" has group or world access; permissions should be u=rw (0600) or less
WARNING: password file "/home/.../.pgpass" has group or world access; permissions should be u=rw (0600) or less
createdb: could not connect to database template1: FATAL: role "..." does not exist
$ /usr/local/pgsql/bin/createdb mydb
bash: /usr/local/pgsql/bin/createdb: No such file or directory
If you encounter an error about being unable to create the postgres service user, turn off any antivirus programs and re-run the installer. >\database directory and manually set the permissions for the \data subdirectory. If the subdirectory \data does not exist, create. Then uninstall PostgreSQL and re-install.
You got one warning and one error.
You can handle the warning by this command of line in your terminal:
$ chmod 600 ~/.pgpass
When you write "psql" in your terminal, Postgres DBMS try to connect to the one database with your computer name but it can't find it. In other hand Postgrest create a database named "postgres" when it install so try connect to this and create your database. You can connect to "postgres" database easily with this command:
$ psql postgres
If you get the "connections on Unix domain socket "/tmp/.s.PGSQL.5432"?" error start your database with this command:
$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
Check the result with this command:
$ pg_ctl -D /usr/local/var/postgres status
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With