Wrong primary key constraint violation on string columns

Details

Detail name Value
Changelog Number 1785
Type Bug
Status Open
Affected Versions EXASolution 5.0.0, Exasol 6.1.1, Exasol 7.0.0, Exasol 7.1.0, Exasol 8.0.0, Exasol 8.29.0, Exasol 2025.1.0, Exasol 2025.2.0, Exasol 2026.1.0

Description

A primary key check throws an exception on string columns if there are values distinguished only by trailing spaces.

Preparation

create table X (v varchar(10));
insert into X values 'ABC';
insert into X values 'ABC  ';

Example

-- exception but values are not identical (wrong exception)
alter table X add primary key (v);

In the above example, an exception is thrown even though the values are unique.

Workaround

There is no workaround

Fix

Primary key checks do not throw an error in this case.