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

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>
Cc: "'Hiroshi Inoue'" <Inoue(at)tpf(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: AW: AW: relation ### modified while in use
Date: 2000-10-23 17:16:21
Message-ID: 3.0.5.32.20001024031621.0325cea0@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 10:10 23/10/00 -0400, Tom Lane wrote:
>
>I consider that behavior *far* safer than allowing schema changes to
>be seen mid-transaction. Consider the following example:
>
> Session 1 Session 2
>
> begin;
>
> INSERT INTO foo ...;
>
> ALTER foo ADD constraint;
>
> INSERT INTO foo ...;
>
> end;
>
>Which, if any, of session 1's insertions will be subject to the
>constraint? What are the odds that the dba will like the result?
>

In this case, wouldn't the answer depend on the isolation level of session
1? For serializable TX, then constraint would not apply; 'read committed'
would mean the constraint was visible on the second insert and at the commit.

I would err on the side of insisting all metadata changes occur in
serializable transactions to make life a little easier.

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2000-10-23 17:29:45 Re: add darwin/osxpb support to cvs
Previous Message Tom Lane 2000-10-23 16:43:53 Re: add darwin/osxpb support to cvs