NPoco icon indicating copy to clipboard operation
NPoco copied to clipboard

Hint() with PostgreSQL

Open PeterN opened this issue 1 year ago • 0 comments

I'm migrating a system that was on MS SQL to PostgreSQL. To help protect against deadlocks, the old code used Hint quite often:

db.Query<Table>().Hint("WITH (UPDLOCK)").Where(...)

The PostgreSQL equivalent is FOR UPDATE, however this is required at the end of the query instead of before the WHERE clause. Is this possible with npoco as is?

It is of course entirely possible that because PostgreSQL is completely different I won't need any such lock hinting.

PeterN avatar Jul 03 '23 09:07 PeterN