Skip to content

Document database socket usage or don't require encoded socket path #5828

@nickdaugherty

Description

@nickdaugherty

Past Issues Searched

  • I have searched open and closed issues to make sure that the bug has not yet been reported

Issue is a Bug Report

  • This is a bug report and not a feature request, nor asking for self-hosted support

Using official Plausible Cloud hosting or self-hosting?

Self-hosting

Describe the bug

When using database sockets, the DATABASE_URL must be formatted in a certain way that is not obvious without digging through the code, so should be documented somewhere.

Specifically, I worked out that the socket file part of the DATABASE_URL must be url-encoded, followed by an unencoded / then the database name. This is pretty confusing, so I'm opening this issue for future searchers and to hopefully get this documented or changed.

Example of correct socket string (the socket file path must be fully url encoded, including characters other than /, but the final / before the database name must not be):

postgres://plausible:password@%2Fpath%2Fto%Fsocket/database_name

Expected behavior

Expected that a non-url-encoded string would work:

postgres://plausible:password@/path/to/socket:file_name/database_name

Screenshots

No response

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions