juspay / services-flake

NixOS-like services for Nix flakes
https://community.flake.parts/services-flake
MIT License
327 stars 28 forks source link

Errors in postgres `initialDatabases` schema are ignored #207

Closed srid closed 2 months ago

srid commented 2 months ago

Using,

          services.postgres."pg" = {
            enable = true;
            initialDatabases = [
              {
                name = "ab_v2";
                schemas = [ ./scripts/db.sql ];
              }
            ];
          };

in an internal project (Infra team), gives:

image

Note the ERROR in the pg-init process. Yet it completed successfully, causing postgres to start. I'd expect the whole thing to fail.

When I scroll up, I can see a cascade of errors actually:

image
srid commented 2 months ago

The same issue exists for initialScript.*:

image