X Tutup
Skip to content

Prepared statement "_auto0" does not exist #6178

@JamesYangLim

Description

@JamesYangLim

Hi,

I have a simple code here in one of my endpoint of my service that uses positional parameter to subdivide a 2D geometry. I also have Max Auto Prepare set to 5.

await using var cmd = _dbDataSource.CreateCommand("SELECT ST_Subdivide($1, 256);");
cmd.Parameters.Add(new NpgsqlParameter
{
    NpgsqlDbType = NpgsqlDbType.Geometry,
    NpgsqlValue = geometry
});

await using var reader = await cmd.ExecuteReaderAsync();

However, I get prepared statement "_auto0" does not exist exception every now and then. Note that, I use named parameter everywhere in my service except here. After I changed this positional parameter to named parameter and the exception seems to go away. I wonder if anyone knows what is happening behind the scene and why this exception occurs?

Metadata

Metadata

Assignees

No one assigned

    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

      X Tutup