Skip to content

Validate column on PostgreSQL padded chars does not handle NULLs #1717

@nj1973

Description

@nj1973

Describe the bug
Validate column on PostgreSQL padded chars does not handle NULLs.

In PR #1513 we worked around a PostgreSQL issue where the char_length() SQL function forces varchar as the input parameter. We changed the expression to char_length(concat(bpchar_col, '')) which protects the trailing space preventing implicit cast from bpchar to varchar from dropping trailing spaces.

Unfortunately the above change did not take NULLs into account. For NULLs the concat with emtpty string turns the NULL into empty string which then has a length of 0 instead of NULL.

What version of DVT are you using?
8.5.2

What type of connections are you using for source and target?
PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions