Skip to content

Issues with NpgsqlCommandBuilder: Incorrect Table Schema and Slow Command Generation #6038

@HumbleGoru

Description

@HumbleGoru

I have a problem with generating commands (Update, Insert, and Delete) through NpgsqlCommandBuilder. The main issue occurs when I set MaxAutoPrepare to a value like 100. After a while, I receive an exception where the Update command is generated after a different SELECT command.

The problem seems to be that the schema table used to generate the Update command belongs to the wrong table. The SELECT command is executed on the Partners table, but the command builder generates the rest of the commands based on a different table in my case, the document_custom_columns table.

The second issue is that generating the first command takes too much time.

We are using PostgreSQL 16.2 and Npgsql 8.0.3.0. Thank you for any help.

Image

Image

Here is an example with the database.

NpgsqlTest.zip
TestDB.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