Skip to content

Type cast in positional function args yields invalid params #520

Closed
@maxhawkins

Description

@maxhawkins
CREATE FUNCTION plus(a integer, b integer) RETURNS integer AS $$
    BEGIN
        RETURN a + b;
    END;
$$ LANGUAGE plpgsql;

-- name: MakeIntervalPositional :one
SELECT plus($1, $2::INTEGER);

yields the params struct

type MakeIntervalPositionalParams struct {
	A       int32
	B       int32
	Column3 int32
}

With an extra field Column3.

The extra field disappears if the INTEGER cast is removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions