Skip to content

Lint warnings on bytea/text casts #8

Description

@zda

FYI, I ran https://github.com/okbob/plpgsql_check against my DB after running the sample Postgres implementation, and I think it's complaining that these two text expressions should be cast to bytea:

alphabet bytea = '0123456789abcdefghjkmnpqrstvwxyz';

id bytea = '\x00000000000000000000000000000000';

[
  {
    "function": "public.base32_decode",
    "issues": [
      {
        "level": "warning",
        "message": "target type is different type than source type",
        "statement": {
          "lineNumber": "22",
          "text": "statement block"
        },
        "hint": "The input expression type does not have an assignment cast to the target type.",
        "detail": "cast \"text\" value to \"bytea\" type",
        "context": "during statement block local variable \"id\" initialization on line 22"
      }
    ]
  }
]

When I added ::bytea the warnings went away. Does that seem correct to you?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions