pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: [HACKERS] Re: [SQL] inserts/updates problem understressing !
2+ messages / 2 participants
[nested] [flat]

* Re: [HACKERS] Re: [SQL] inserts/updates problem understressing !
@ 1999-07-26 02:50  Vadim Mikheev <vadim@krs.ru>
  0 siblings, 1 reply; 2+ messages in thread

From: Vadim Mikheev @ 1999-07-26 02:50 UTC (permalink / raw)
  To: Philip Warner <pjw@rhyme.com.au>; +Cc: pgsql-hackers@postgreSQL.org, pgsql-sql@postgreSQL.org, Oleg Bartunov <oleg@sai.msu.su>

Philip Warner wrote:
> 
> The usual way around this sort of problem is to update the counter as the
> first thing you do in any transaction. This locks the row and prevents any
> possible deadlock:

But if there was no record then nothing will be locked...
Without ability to read dirty data LOCK is the only way.

...

> diagnostics' is not yet applied (I may not have mailed it yet...), and I am
> not sure if plpgsql starts a new TX for each statment - if so, you need to
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It doesn't.

> start a TX in the procedure, or prior to valling it.

Vadim



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

* Re: [HACKERS] Re: [SQL] inserts/updates problem understressing !
@ 1999-07-26 06:28  Oleg Bartunov <oleg@sai.msu.su>
  parent: Vadim Mikheev <vadim@krs.ru>
  0 siblings, 0 replies; 2+ messages in thread

From: Oleg Bartunov @ 1999-07-26 06:28 UTC (permalink / raw)
  To: Vadim Mikheev <vadim@krs.ru>; +Cc: Philip Warner <pjw@rhyme.com.au>; pgsql-hackers@postgreSQL.org

On Mon, 26 Jul 1999, Vadim Mikheev wrote:

> Date: Mon, 26 Jul 1999 10:50:28 +0800
> From: Vadim Mikheev <vadim@krs.ru>
> To: Philip Warner <pjw@rhyme.com.au>
> Cc: pgsql-hackers@postgreSQL.org, pgsql-sql@postgreSQL.org,
>     Oleg Bartunov <oleg@sai.msu.su>
> Subject: Re: [HACKERS] Re: [SQL] inserts/updates problem understressing !
> 
> Philip Warner wrote:
> > 
> > The usual way around this sort of problem is to update the counter as the
> > first thing you do in any transaction. This locks the row and prevents any
> > possible deadlock:
> 
> But if there was no record then nothing will be locked...
> Without ability to read dirty data LOCK is the only way.
> 

I agree, no data, no locking.

> ...
> 
> > diagnostics' is not yet applied (I may not have mailed it yet...), and I am
> > not sure if plpgsql starts a new TX for each statment - if so, you need to
>                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> It doesn't.
> 
> > start a TX in the procedure, or prior to valling it.

How do I start a TX in the procedure ? Is't possible ?
I don't understand this because a procedure must return something, so 
there're no point where to end a TX.

	Oleg
> 
> Vadim
> 

_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83




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


end of thread, other threads:[~1999-07-26 06:28 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-07-26 02:50 Re: [HACKERS] Re: [SQL] inserts/updates problem understressing ! Vadim Mikheev <vadim@krs.ru>
1999-07-26 06:28 ` Oleg Bartunov <oleg@sai.msu.su>

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