question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Redshift numeric issue after upgrading to cluster version 1.0.27554

See original GitHub issue

After upgrading Redshift from cluster version 1.0.27085 to 1.0.27554, the numeric values returned from queries through npgsql are way off.

Steps to reproduce

Execute a query that returns a numeric and extract it using either GetDecimal og GetDouble:

await using(var conn = new NpgsqlConnection(connString))
{
    await conn.OpenAsync();
    
     await using (var cmd = new NpgsqlCommand("select cast(12.34 as numeric(8,2)) as n", conn))
    {
        await using (var reader = await cmd.ExecuteReaderAsync())
        {
            while (await reader.ReadAsync())
            {
                Console.WriteLine(reader.GetDecimal(0));
            }
        }
    }
}

The issue

The above code writes 123400000000,0000 and not as expected the value 12.34

When executing the code against a cluster with version 1.0.27085, the correct value 12.34 is returned.

Using ODBC driver still returns the correct numeric values on cluster version 1.0.27554.

For now, I have downgraded our cluster to 1.0.27085 and deferred the maintenance window until the 23rd of July, but after that I’m going to have big issues.

Further technical details

Npgsql version: 5.0.7 Redshift version: 1.0.27554 Operating system: N/A

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
faarbaekcommented, Jun 21, 2021

I just tried to create a new cluster, and it seems like this issue has been solved by AWS as with the new cluster version 1.0.27747 it works like expected.

1reaction
YohDeadfallcommented, Jun 17, 2021

Could you post binary data returned by Red Shift? And have you contacted their support and tried another drivers? You even can try to execute a query in DataGrip or any other JetBrains product since all of them utilize JDBC.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cluster versions for Amazon Redshift
Amazon Redshift regularly releases cluster versions. Your Amazon Redshift clusters are patched during your system maintenance window.
Read more >
Amazon Redshift clusters - AWS Documentation
Learn the basics of creating a data warehouse by launching a set of compute nodes, called an Amazon Redshift cluster.
Read more >
How do I troubleshoot Amazon Redshift connection errors?
Invalid operation connection error · 1. Open the Amazon Redshift console. · 2. Choose the Config tab. · 3. Modify the parameter group...
Read more >
Amazon Redshift Numeric: 3 Data Types Simplified
This article provides you with an in-depth guide about Amazon Redshift Numeric data types. Upon a complete walkthrough of the article, ...
Read more >
Redshift Cluster Default Port
Running your Redshift database clusters on the default port represent a potential security concern. Replacing the default port number (5439) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found