BLERe: AW: AW: relation ### modified while in use

From: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
To: Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>
Cc: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: BLERe: AW: AW: relation ### modified while in use
Date: 2000-10-24 00:20:36
Message-ID: 39F4D5D4.5E512AB4@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Zeugswetter Andreas SB wrote:

> > > > What I'm proposing is that once an xact has touched a
> > > > table, other xacts should not be able to apply schema updates to that
> > > > table until the first xact commits.
> > >
> > > No, this would mean too many locks, and would leave the dba with hardly a
> > > chance to alter a table.
> > >
> >
> > Are there many applications which have many SELECT statements(without
> > FOR UPDATE) in one tx ?
>
> Why not ?
>

It seems to me that multiple SELECT statements in a tx has little
meaning unless the tx is executed in SERIALIZABLE isolation level.

>
> > As for locks,weak locks doesn't pass intensive locks. Dba
> > seems to be able to alter a table at any time.
>
> Sorry, I don't understand this sentence. Tom suggested placing a shared lock on
> any table that is accessed until end of tx. Noone can alter table until all users have
> closed their txns and not accessed tables again. Remember that this would include
> creating an index ...
>

What I meant is the following though I may be misunderstanding your point.

Session-1.
# begin;
# declare myc cursor for select * from t1;

Session-2.
# begin;
# lock table t1; [blocked]

Session-3.
# begin;
# select * from t1; [blocked]

Session-1.
# abort;

Then
Session-2.
LOCK TABLE
#

but
Session-3.
[still blocked]

Regards.
Hiroshi Inoue

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Inoue 2000-10-24 00:52:19 Re: relation ### modified while in use
Previous Message Hiroshi Inoue 2000-10-24 00:03:38 Re: relation ### modified while in use