Q004warning

Expression type error

The type of an expression could not be inferred.

db/queries/example.sql:2:1: warning[Q004]: parameter name is used both where text and where int8 is expected, which the engine converts between only explicitly; the generated code takes text, so a value of the other type fails; cast one use, or pass the value as two parameters
Printed by sgl from a small PostgreSQL reproduction project.

When it is reported

The analyser could not work out what type an expression in the select list produces, so the output column is typed as unknown.

How to fix it

Add an explicit cast, or pin the column's type with sgl.column(name, type: ...).

In your terminal

$ sgl explain Q004

Look for ExpressionTypeError in Seagull's source to see where it is reported.