SkunkException: Just constructed an unknown completion 'SELECT' when using Amazon Redshift
When using Amazon Redshift with Skunk v0.6.4, we're getting SkunkException: Just constructed an unknown completion 'SELECT' messages logged after running SELECT queries.
The modifications in Completion and CommandComplete are variations on the protocol to better support Redshift, which apparently doesn't return a count for a SELECT statement. The protocol documentation appears to say it should:
For a
SELECTorCREATE TABLE AScommand, the tag isSELECT rowswhererowsis the number of rows retrieved.
but comments in the JDBC driver state:
Parses
CommandComplete (B)message. [The value being parsed] is in the format ofCOMMAND OID ROWSwhere bothOIDandROWSare optional andCOMMANDcan have spaces within it, likeCREATE TABLE.
so clients should probably be prepared to handle this?
Practically speaking, true Postgres servers do return row counts, but Redshift does not.
I'm not sure whether the other CommandComplete cases with required counts (Delete, Update, Insert, Copy, and Merge) should also be adjusted accordingly. I haven't tried those types of queries yet so I'm not sure whether Skunk emits the same warning.