Skip to content

Support connection service file and service names#868

Closed
feikesteenbergen wants to merge 1 commit intolib:masterfrom
feikesteenbergen:use_service_file
Closed

Support connection service file and service names#868
feikesteenbergen wants to merge 1 commit intolib:masterfrom
feikesteenbergen:use_service_file

Conversation

@feikesteenbergen
Copy link
Copy Markdown

The whole point of supporting this can best be said by directly quoting
the PostgreSQL manual:

The connection service file allows libpq connection parameters to be
associated with a single service name. That service name can then be
specified by a libpq connection, and the associated settings will be
used. This allows connection parameters to be modified without
requiring a recompile of the libpq application. The service name can
also be specified using the PGSERVICE environment variable.

source: https://www.postgresql.org/docs/current/libpq-pgservice.html

Fixes #538

The whole point of supporting this can best be said by directly quoting
the PostgreSQL manual:

> The connection service file allows libpq connection parameters to be
> associated with a single service name. That service name can then be
> specified by a libpq connection, and the associated settings will be
> used. This allows connection parameters to be modified without
> requiring a recompile of the libpq application. The service name can
> also be specified using the PGSERVICE environment variable.

source: https://www.postgresql.org/docs/current/libpq-pgservice.html

Fixes lib#538
@ribasushi
Copy link
Copy Markdown

@rafiss ping on this PR? Seems pretty decent.

The alternative today is to use something like this, which I have to admit is pretty gross... https://github.com/behrang/go-pgservice

arp242 added a commit that referenced this pull request Mar 17, 2026
Allow reading connection from a service file if "service=name" is used.

Based on #868

Co-authored-by: Feike Steenbergen <[email protected]>

Fixes #538
Closes #868
arp242 added a commit that referenced this pull request Mar 17, 2026
Allow reading connection from a service file if "service=name" is used.

Based on #868

Co-authored-by: Feike Steenbergen <[email protected]>

Fixes #538
Closes #868
arp242 added a commit that referenced this pull request Mar 17, 2026
Allow reading connection from a service file if "service=name" is used.

Based on #868

Co-authored-by: Feike Steenbergen <[email protected]>

Fixes #538
Closes #868
arp242 added a commit that referenced this pull request Mar 17, 2026
Allow reading connection from a service file if "service=name" is used.

Based on #868

Co-authored-by: Feike Steenbergen <[email protected]>

Fixes #538
Closes #868
@arp242 arp242 closed this in #1285 Mar 17, 2026
@arp242
Copy link
Copy Markdown
Collaborator

arp242 commented Mar 17, 2026

Merged via #1285, as re-implementing this from scratch was easier than solving the conflicts on this 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Connection Service File

3 participants