Re: SQL Server's WITH (NOLOCK) equivalent in PostgreSQL?

2025-03-30 Thread David G. Johnston
On Sunday, March 30, 2025, 이현진 wrote: > > Since PostgreSQL uses MVCC, I'm wondering what the best practice is for > non-blocking reads, > and whether there's an equivalent to dirty reads or READ UNCOMMITTED. > https://www.postgresql.org/docs/current/transaction-iso.html We are unable to impleme

Re: SQL Server's WITH (NOLOCK) equivalent in PostgreSQL?

2025-03-30 Thread Christophe Pettus
> On Mar 30, 2025, at 21:44, 이현진 wrote: > Since PostgreSQL uses MVCC, I'm wondering what the best practice is for > non-blocking reads, > and whether there's an equivalent to dirty reads or READ UNCOMMITTED. There are two different questions here. 1. Reads are not blocked in PostgreSQL by w

SQL Server's WITH (NOLOCK) equivalent in PostgreSQL?

2025-03-30 Thread 이현진
Hi all, I'm trying to understand how to replicate SQL Server's WITH (NOLOCK) behavior in PostgreSQL. Since PostgreSQL uses MVCC, I'm wondering what the best practice is for non-blocking reads, and whether there's an equivalent to dirty reads or READ UNCOMMITTED. Would appreciate any insights or r

Re: Querying one partition in a function takes locks on all partitions

2025-03-30 Thread Tom Lane
David Rowley writes: > On Sat, 29 Mar 2025 at 10:30, Renan Alves Fonseca > wrote: >> Currently, in the SQL function path the plan is always generic. The >> planner ignores the function arguments. The plan_cache_mode setting >> has no effect in this path. >> I agree that the docs should be more ex

Re: Querying one partition in a function takes locks on all partitions

2025-03-30 Thread David Rowley
On Sat, 29 Mar 2025 at 10:30, Renan Alves Fonseca wrote: > Currently, in the SQL function path the plan is always generic. The > planner ignores the function arguments. The plan_cache_mode setting > has no effect in this path. > > I agree that the docs should be more explicit about this. There is