-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cli: add tests for PGPASSFILE and PGSERVICEFILE #82389
Conversation
0ce0cbc
to
c902e63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r1.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @rafiss)
-- commits
line 4 at r1:
"The CLI" ->
CLI commands that use a SQL connection (e.g. `cockroach sql`, `cockroach node status`, etc) now ...
ditto below
Release note (cli change): CLI commands that use a SQL connection (e.g. `cockroach sql`, `cockroach node status`, etc) now support connecting with PGPASSFILE and PGSERVICEFILE. The behavior is compatible with how libpq (the psql C library) behaves. PGPASSFILE defaults to ~/.pgpass. It is a file that contains lines in the format ``` hostname:port:database:username:password ``` The password field from the first line that matches the current connection parameters will be used to connect to the database. PGSERVICEFILE defaults to ~/.pg_service.conf. It is a file that contains lines in the format ``` [myservice] host=somehost port=26257 user=someuser ``` Any connection parameters (including passfile or password) can be specified here. Then, a connection string that specifies the `service=myservice` connection parameter will use the values in PGSERVICEFILE to connect. Release note (cli change): CLI commands that use a SQL connection (e.g. `cockroach sql`, `cockroach node status`, etc) now default to using the the file in ~/.postgresql/root.crt for the `sslrootcert` when connecting. The file can still be configured using the PGSSLROOTCERT environment variable or the `sslrootcert` URL parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tftr!
bors r=knz
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @knz)
Previously, knz (kena) wrote…
"The CLI" ->
CLI commands that use a SQL connection (e.g. `cockroach sql`, `cockroach node status`, etc) now ...
ditto below
fixed
Build failed (retrying...): |
Build failed (retrying...): |
Build succeeded: |
Release note (cli change): The CLI now supports connecting with PGPASSFILE
and PGSERVICEFILE. The behavior is compatible with how libpq (the psql C
library) behaves.
PGPASSFILE defaults to ~/.pgpass. It is a file that contains lines in the format
The password field from the first line that matches the current connection
parameters will be used to connect to the database.
PGSERVICEFILE defaults to ~/.pg_service.conf. It is a file that contains
lines in the format
Any connection parameters (including passfile or password) can be specified here.
Then, a connection string that specifies the
service=myservice
connectionparameter will use the values in PGSERVICEFILE to connect.
Release note (cli change): The CLI now defaults to using the the file in
~/.postgresql/root.crt for the
sslrootcert
when connecting. The file canstill be configured using the PGSSLROOTCERT environment variable or
the
sslrootcert
URL parameter.