skunk icon indicating copy to clipboard operation
skunk copied to clipboard

SkunkException: Just constructed an unknown completion 'SELECT' when using Amazon Redshift

Open bpholt opened this issue 1 month ago • 0 comments

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 SELECT or CREATE TABLE AS command, the tag is SELECT rows where rows is the number of rows retrieved.

but comments in the JDBC driver state:

Parses CommandComplete (B) message. [The value being parsed] is in the format of COMMAND OID ROWS where both OID and ROWS are optional and COMMAND can have spaces within it, like CREATE 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.

bpholt avatar Nov 09 '25 23:11 bpholt