Skip to content

Conversation

@taimoorzaeem
Copy link
Collaborator

Renames these scripts to postgrest-with-pg-xx. The renaming helps reduce the length of temporary filenames. This is needed to ensure that socket file names remain under the maximum allowed length of 107 chars.

Closes #4461.

@taimoorzaeem taimoorzaeem force-pushed the nix/fix-unix-socket-length branch from 2c2c72b to 71ada9d Compare November 15, 2025 08:42
@taimoorzaeem taimoorzaeem added hygiene cleanup or refactoring nix related to Nix tooling labels Nov 15, 2025
Copy link
Member

@wolfgangwalther wolfgangwalther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with renaming, but let's separate the socket change into another commit.

Also please have a look at this:

mkdir -p "''${TMPDIR:-/tmp}/postgrest"
tmpdir="$(${coreutils}/bin/mktemp -d --tmpdir postgrest/${name}-XXX)"

I think we can just remove the /postgrest/ path component entirely - we will have that part as prefix in every name anyway.

Comment on lines 90 to 96
replica_host="$tmpdir/socket_$replica_slot"
replica_host="$tmpdir/sock_$replica_slot"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should just run the replica on the same socket path as the primary, but use a different port (it will then create a different socket). That would save a whole level of the path.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea! I will try to do these changes in a separate PR.

@taimoorzaeem taimoorzaeem marked this pull request as draft November 15, 2025 14:34
Renames these scripts to `postgrest-with-pg-xx`. The renaming
helps reduce the length of temporary filenames. This is needed
to ensure that socket file names remain under the maximum
allowed length of 107 chars.

Closes PostgREST#4461.

Signed-off-by: Taimoor Zaeem <[email protected]>
@taimoorzaeem taimoorzaeem force-pushed the nix/fix-unix-socket-length branch from 71ada9d to 7210385 Compare November 16, 2025 06:04
@taimoorzaeem taimoorzaeem marked this pull request as ready for review November 16, 2025 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hygiene cleanup or refactoring nix related to Nix tooling

Development

Successfully merging this pull request may close these issues.

nix: postgrest-test-replica fails locally

2 participants