Skip to content

Typecasting documentation / matrix contains incorrect information. Also, could be improved by making it plaintext rather than image and auto-generate it in CI #1845

Open
@rpbouman

Description

The typecasting matrix in https://duckdb.org/docs/sql/data_types/typecasting has a couple of issues:

  • contains wrong information. For example, according to the chart, VARCHAR cannot be cast to any target type, contradicting the many examples in the prior data type section that illustrate how to create literal values for the various types, which often use constructs like '0101'::BIT
  • is hard to read. The orange bullets tend to drown in the sea of red crosses.
  • isn't really friendly to share the info because it is an image. It's probably not very accessible too for people that rely on screenreaders.
  • could be improved by conveying not merely whether a cast is possible, but also whether a cast is 'safe', i.e. whether or not the reverse cast will always yield the original value. For example, casting a TINYINT value to an INTEGER value is safe, because the resulting INTEGER value can be cast back to TINYINT again and it will be identical to the original TINYINT value.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions