Talk:PostgreSQL: Difference between revisions

From NixOS Wiki
imported>Maikelthedev
TCP/IP version misses the local auth and can't run
 
imported>Maikelthedev
m reformatted the parts that were nix code
 
Line 1: Line 1:
The instructions are incomplete and lead to a systm that never runs because is missing the local part. This is what worked for me.  
The instructions are incomplete and lead to a systm that never runs because is missing the local part. This is what worked for me.  


<pre>
   services.postgresql = {
   services.postgresql = {
     settings = {
     settings = {
Line 13: Line 14:
     '';
     '';
   };
   };
</pre>


if you just do the part that accepts TCP connections WITHOUT the local, it just doesn't run because it is missing it.
if you just do the part that accepts TCP connections WITHOUT the local, it just doesn't run because it is missing it.

Latest revision as of 18:32, 22 January 2024

The instructions are incomplete and lead to a systm that never runs because is missing the local part. This is what worked for me.

  services.postgresql = {
    settings = {
      listen_addresses = "*";  
    };
    enable = true;
    enableTCPIP = true;
    authentication = pkgs.lib.mkOverride 10 ''
local all       all     trust
host all all      ::1/128      trust
host all postgres 127.0.0.1/32 trust
    '';
  };

if you just do the part that accepts TCP connections WITHOUT the local, it just doesn't run because it is missing it.