Skip to content

PostgresException: 42804 when executing several queries with parameters with one open connection #6067

@HoMS1987

Description

@HoMS1987

When executing Queries with parameters on the same table, I get the error:
Npgsql.PostgresException: 42804: Column »bool1« has Type boolean but expression has type integer

But when debugging the datatype of the NpgsqlParameter is correct, directly before I call ExecuteNonQuery()

I attached a little test project, that reproduces this error.
Only the connection string inside has to be adjustet.
It creates a new database, a new table and first tries to update a row (which is not still there) and as it couldn't update the row it creates it.
During the creation of this row the Exception is thrown.

NpgsqlTest.zip

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions