![]() Concealing and obscuring the name of the superuser has advantages. By keeping this disabled, you remove the risk of a brute force attack through a named super-user.When available, this is the recommended way to install PostgreSQL, since it provides proper integration with the operating system, including automatic patching and other management. PostgreSQL is available integrated with the package management on most Linux platforms. And, that means that you could normally wreck havoc anyway. Debian Red Hat/Rocky SUSE Ubuntu Other Linux Generic linux distributions. This normally means in order to log in as postgres which is the PostgreSQL equivalent of SQL Server's SA, you have to have write-access to the underlying data files. It's normally not password protected and delegates to the host operating system.You're supposed to have root to get to authenticate as postgres. No one is supposed to "log in" to the operating system as postgres. I suggest NOT modifying the postgres user. Or, $ grep "port =" /etc/postgresql/*/main/nf If you don't know the port, you can always get it by running the following, as the postgres user, SHOW port Then you can login, $ psql -h localhost -d mydatabase -U myuser -p Using the SQL administration commands, and connecting with a password over TCP $ sudo -u postgres psql postgresĪnd, then in the psql shell CREATE ROLE myuser LOGIN PASSWORD 'mypass' ĬREATE DATABASE mydatabase WITH OWNER = myuser Using createuser and createdb, $ sudo -u postgres createuser -s $USER Both require creating a user and a database. ![]() It's easy on Debian/Ubuntu sudo apt-get install postgresql That will all be done for you by the installer. Note that you don't need to do anything special like run initdb manually after installing it this way. 8.4, 9.0, 9.1, 9.2, or 9.3Īpt-get install "postgresql-$" sudo apt-get install -y postgresql postgresql-client libpq-dev Open the PostgreSQL interactive terminal to create a new database and user for Gogs: sudo -u postgres psql -d template1 The output looks like this: psql (9.4.4) Type 'help' for help. # Edit this to the version you'd like to install, e.g. PG_REPO_APT_SOURCE=/etc/apt//pgdg.listĮcho "deb precise-pgdg main" > "$PG_REPO_APT_SOURCE" To install a different version, just change the PG_VERSION variable name to the version you'd like to install.Īlso listed below is how to install the contrib module which allows you to install a lot of the more popular extensions (like hstore) via CREATE EXTENSION. The instructions below install PostgreSQL 9.3. Installing PostgreSQL on Ubuntu is really easy. They're more up to date and allow you to also install 9.2 or 9.3 (the latest stable release as of the time of writing this). An alternative (listed below) is to use the PGDG APT repositories. The standard Ubuntu 12.04 repositories currently have PostgreSQL version 9.1. As of the time of writing this the oldest supported version is 8.4.Īlthough even 8.4 is still supported, if you're doing a new install it's recommended that you install a newer version. They are for version 8.3 which is no longer supported. The instructions you link to are out of date.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |