PostgreSQL: Difference between revisions

imported>Ariutta
m (Specify updated package name. Close brace.)
imported>Ariutta
(Add examples for 17.09 and later)
Line 10: Line 10:
There is no password, [https://www.postgresql.org/docs/9.6/static/auth-methods.html#AUTH-IDENT Ident Authentication] [https://github.com/NixOS/nixpkgs/blob/release-17.09/nixos/modules/services/databases/postgresql.nix#L182 is used]. This means that you can access the database using a system user named like the database user.
There is no password, [https://www.postgresql.org/docs/9.6/static/auth-methods.html#AUTH-IDENT Ident Authentication] [https://github.com/NixOS/nixpkgs/blob/release-17.09/nixos/modules/services/databases/postgresql.nix#L182 is used]. This means that you can access the database using a system user named like the database user.


Example for a 17.03 stateVersion.
Example for a 17.03 stateVersion:


<syntaxhighlight lang="commands">
<syntaxhighlight lang="commands">
Line 28: Line 28:


The first error is not an error with the credentials, but an error coming from the default behaviour of <code>psql</code> that is trying to use a database name named like the user logging-in. The second command lists tables available.
The first error is not an error with the credentials, but an error coming from the default behaviour of <code>psql</code> that is trying to use a database name named like the user logging-in. The second command lists tables available.
Examples for a 17.09 stateVersion and later:
<syntaxhighlight lang="commands">
$ psql -U postgres
</syntaxhighlight>
and
<syntaxhighlight lang="commands">
$ psql -U postgres -l
</syntaxhighlight>


=== Deploying databases ===
=== Deploying databases ===