Skip to content

Tags: lib/pq

Tags

v1.12.1

Toggle v1.12.1's commit message
Release v1.12.1

v1.12.0

Toggle v1.12.0's commit message

Verified

This commit was signed with the committer’s verified signature.
arp242 Martin Tournoij
Change default sslmode from "require" to "prefer"

Now that sslmode=prefer is supported, we can use that as the default.

"prefer" is the default used by libpq, pgx, and pretty much anything
else connecting to PostgreSQL. I can't really find anything else that
uses "require" as a default.

You could argue that "require" is a better default, but:

1. "require" doesn't actually verify the certificates and accepts any
   certificate. I wouldn't say it's completely useless for production
   systems, but it does seem useless-adjacent. If you want SSL, you
   almost always want "verify-ca" or "verify-full".

2. Copy/pasting a connection string used by pq to something else will
   mean you silently drop the ssl so it's a very brittle default.

3. It's an annoying default because copy pasting a connection string
   from anything else to pq doesn't work.

pq has used "require" as a default for a long time, but because it's
such a brittle default that's easy to lose by using $anything_else I
think it's okay to change.

I will leave this open for a bit before merging, so if anyone objects it
can be re-considered.

v1.11.2

Toggle v1.11.2's commit message

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
Don't send empty startup parameters

That's also what libpq does; from src/interfaces/libpq/fe-protocol3.c

	if (conn->pguser && conn->pguser[0])
		ADD_STARTUP_OPTION("user", conn->pguser);
	if (conn->dbName && conn->dbName[0])
		ADD_STARTUP_OPTION("database", conn->dbName);
	if (conn->replication && conn->replication[0])
		ADD_STARTUP_OPTION("replication", conn->replication);
	if (conn->pgoptions && conn->pgoptions[0])
		ADD_STARTUP_OPTION("options", conn->pgoptions);
	if (conn->send_appname) {
		/* Use appname if present, otherwise use fallback */
		val = conn->appname ? conn->appname : conn->fbappname;
		if (val && val[0])
			ADD_STARTUP_OPTION("application_name", val);
	}
	if (conn->client_encoding_initial && conn->client_encoding_initial[0])
		ADD_STARTUP_OPTION("client_encoding", conn->client_encoding_initial);

Sending an empty value works for most systems, but not in Supavisor due
to a bug there. Easy enough to fix here, so why not.

Fixes #1259

Co-authored-by: Martin Tournoij <martin@arp242.net>

v1.11.1

Toggle v1.11.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release v1.11.1 (#1255)

v1.11.0

Toggle v1.11.0's commit message
Release 1.11.0

v1.10.9

Toggle v1.10.9's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
add version check for go 1.15 (#1123)

v1.10.8

Toggle v1.10.8's commit message
remove stray debugging code

v1.10.7

Toggle v1.10.7's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Merge pull request #1088 from kelvich/sni_support

v1.10.6

Toggle v1.10.6's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Merge pull request #1081 from catj-cockroach/add-kubernetes-secret-su…

…pport

adds support for kubernetes mounted private keys

v1.10.5

Toggle v1.10.5's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Merge pull request #1074 from lib/fix-assertions

Avoid asserting on error message for cancel tests