pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
select locks table for updates
5+ messages / 4 participants
[nested] [flat]

* select locks table for updates
@ 2020-11-19 10:06 Yambu <hyambu@gmail.com>
  2020-11-19 10:19 ` RE: select locks table for updates Michel SALAIS <msalais@msym.fr>
  0 siblings, 1 reply; 5+ messages in thread

From: Yambu @ 2020-11-19 10:06 UTC (permalink / raw)
  To: Pgsql-admin <pgsql-admin@lists.postgresql.org>

Hi

Does a select lock tables for updates?

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* RE: select locks table for updates
  2020-11-19 10:06 select locks table for updates Yambu <hyambu@gmail.com>
@ 2020-11-19 10:19 ` Michel SALAIS <msalais@msym.fr>
  2020-11-19 10:27   ` Re: select locks table for updates Alexander Shelemin <shelemin@gmail.com>
  2020-11-19 21:13   ` Re: select locks table for updates Simon Riggs <simon@2ndquadrant.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Michel SALAIS @ 2020-11-19 10:19 UTC (permalink / raw)
  To: 'Yambu' <hyambu@gmail.com>; 'Pgsql-admin' <pgsql-admin@lists.postgresql.org>

No! Not in PostgreSQL. 

However it is true for SQL Server.

 

Michel SALAIS

De : Yambu <hyambu@gmail.com> 
Envoyé : jeudi 19 novembre 2020 11:07
À : Pgsql-admin <pgsql-admin@lists.postgresql.org>
Objet : select locks table for updates

 

Hi

 

Does a select lock tables for updates?

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: select locks table for updates
  2020-11-19 10:06 select locks table for updates Yambu <hyambu@gmail.com>
  2020-11-19 10:19 ` RE: select locks table for updates Michel SALAIS <msalais@msym.fr>
@ 2020-11-19 10:27   ` Alexander Shelemin <shelemin@gmail.com>
  1 sibling, 0 replies; 5+ messages in thread

From: Alexander Shelemin @ 2020-11-19 10:27 UTC (permalink / raw)
  To: Michel SALAIS <msalais@msym.fr>; +Cc: Yambu <hyambu@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>

That depends on transaction isolation level. By default sql server doesn't
use MVCC, so selects need shared locks. It's easily changed, though.

On Thu, 19 Nov 2020, 11:20 Michel SALAIS, <msalais@msym.fr> wrote:

> No! Not in PostgreSQL.
>
> However it is true for SQL Server.
>
>
>
> *Michel SALAIS*
>
> *De :* Yambu <hyambu@gmail.com>
> *Envoyé :* jeudi 19 novembre 2020 11:07
> *À :* Pgsql-admin <pgsql-admin@lists.postgresql.org>
> *Objet :* select locks table for updates
>
>
>
> Hi
>
>
>
> Does a select lock tables for updates?
>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: select locks table for updates
  2020-11-19 10:06 select locks table for updates Yambu <hyambu@gmail.com>
  2020-11-19 10:19 ` RE: select locks table for updates Michel SALAIS <msalais@msym.fr>
@ 2020-11-19 21:13   ` Simon Riggs <simon@2ndquadrant.com>
  2020-11-19 22:31     ` RE: select locks table for updates Michel SALAIS <msalais@msym.fr>
  1 sibling, 1 reply; 5+ messages in thread

From: Simon Riggs @ 2020-11-19 21:13 UTC (permalink / raw)
  To: Michel SALAIS <msalais@msym.fr>; +Cc: Yambu <hyambu@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>

On Thu, 19 Nov 2020 at 10:20, Michel SALAIS <msalais@msym.fr> wrote:
>
> No! Not in PostgreSQL.

In normal SELECTs, that is correct.

If you use SELECT ... FOR UPDATE then rows will be locked.

-- 
Simon Riggs                http://www.EnterpriseDB.com/





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* RE: select locks table for updates
  2020-11-19 10:06 select locks table for updates Yambu <hyambu@gmail.com>
  2020-11-19 10:19 ` RE: select locks table for updates Michel SALAIS <msalais@msym.fr>
  2020-11-19 21:13   ` Re: select locks table for updates Simon Riggs <simon@2ndquadrant.com>
@ 2020-11-19 22:31     ` Michel SALAIS <msalais@msym.fr>
  0 siblings, 0 replies; 5+ messages in thread

From: Michel SALAIS @ 2020-11-19 22:31 UTC (permalink / raw)
  To: 'Simon Riggs' <simon@2ndquadrant.com>; +Cc: 'Yambu' <hyambu@gmail.com>; 'Pgsql-admin' <pgsql-admin@lists.postgresql.org>

I think the original question wasn't about what can be done. Any way that is how I considered it. A simple question, a simple reply taking into account default behavior only. The point was just to say that things don't go the same everywhere...

Michel SALAIS

-----Message d'origine-----
De : Simon Riggs <simon@2ndquadrant.com> 
Envoyé : jeudi 19 novembre 2020 22:14
À : Michel SALAIS <msalais@msym.fr>
Cc : Yambu <hyambu@gmail.com>; Pgsql-admin <pgsql-admin@lists.postgresql.org>
Objet : Re: select locks table for updates

On Thu, 19 Nov 2020 at 10:20, Michel SALAIS <msalais@msym.fr> wrote:
>
> No! Not in PostgreSQL.

In normal SELECTs, that is correct.

If you use SELECT ... FOR UPDATE then rows will be locked.

-- 
Simon Riggs                http://www.EnterpriseDB.com/







^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2020-11-19 22:31 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19 10:06 select locks table for updates Yambu <hyambu@gmail.com>
2020-11-19 10:19 ` Michel SALAIS <msalais@msym.fr>
2020-11-19 10:27   ` Alexander Shelemin <shelemin@gmail.com>
2020-11-19 21:13   ` Simon Riggs <simon@2ndquadrant.com>
2020-11-19 22:31     ` Michel SALAIS <msalais@msym.fr>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox