Postgresql.vm.nurd.space: Difference between revisions

From NURDspace
No edit summary
No edit summary
Line 15: Line 15:
This container is currently very unhappy.
This container is currently very unhappy.
After boot, you have to manually start networking and postgres.
After boot, you have to manually start networking and postgres.
<pre>
service postgresql start
service networking start
</pre>


== Versions ==
== Versions ==

Revision as of 14:53, 30 October 2020

NURDs Inventory
PostgreSQL.png
Owner Space
Status Infrastructure
Hostname postgresql.vm.nurd.space
Location Coherence
Tool No
Tool category

{{{Name}}}Property "Tool Name" (as page type) with input value "{{{Name}}}" contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process.

PostgreSQL.png {{{InventoryOwner}}}Property "Tool Owner" (as page type) with input value "{{{InventoryOwner}}}" contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process. Coherence

What

This is a PostgreSQL server. For documentation refer to [1]

Shit is broken yo

This container is currently very unhappy. After boot, you have to manually start networking and postgres.

service postgresql start
service networking start

Versions

  • 9.1 on port 5432 (used)
  • 9.4 on port 5433 (currently unused)
  • 9.6 on port 9434 (currently unused)

Documentation

This machine has ldap authentication enabled.

Just a few pointers about creating databases and authentication:

If you are logged in on the shell of a postgres machine, postgresql normally uses Ident authentication. This means that starting using postgresql command-line tools, logs you in as the postgresql user with the same name as your shell user.

To log in to the postgresql command-line tool with the postgresql equivalent of the root user (called postgres), execute

sudo -u postgres psql

By default you log-in to the database with the same name as your username. To log-in to a different database do:

sudo -u postgres psql -d <dbname>

Databases and users can be created with normal command-line tools. To create a user and database owned by it, do:

sudo -u postgres createuser -P <username>
sudo -u postgres createdb -U UTF8 -T template0 -O <username> <username>

It is best to create databases with the same name as the owner. This is due to pg_hba.conf. This file (in /etc/postgres/<version>/main/), defines which user is allowed to log-in to which database, from which host and with which method. By default, postgres allows the postgres user to log into any database, and users only from localhost into databases with the same name as their username when password authentication is used.

If you need username/password authentication from other hosts, add a line to pg_hba.conf, allowing it.