server/db/driver/pg: log postgres notices #1226
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This updates the postgresql driver, lib/pq, from 1.2.0 to 1.10.3. This contains no breaking changes. It is primarily some bug fixes, also a few context enabled methods, new array types, and support for handling postgres notices.
Notices from postgres are now handled by logging them according to their severity and error code class using the new
pq.ConnectorWithNoticeHandler
Connector
factory function. There is some ambiguity in severity levels, but this will at least log anything important that was previously ignored.'pgonline' tests are still passing.
In addition to the pq update and notice logging, remove an old pseudo-upgrade.
This pseudo-upgrade was added prior to the first release and prior to schema versioning that would create the
matches.forgiven
column if it does not exist. It has existed in theCREATE TABLE
statement since first release so thisALTER TABLE
is always a no-op that just results in a loggedNOTICE
:[DBG] DB: pq: NOTICE (42701) - duplicate_column: column "forgiven" of relation "matches" already exists, skipping
The comments around this indicate the same, that this should have been removed when actual upgrades were implemented. Schema v1 does indeed include this
forgiven
column, and this change can thus remove theALTER TABLE
statement that tries to re-add it on every startup.The
forgiven
column was on v0.1.0: 73d04b4