Re: Heads up: 7.3.3 this Wednesday

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: "A(dot)Bhuvaneswaran" <bhuvansql(at)myrealbox(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Heads up: 7.3.3 this Wednesday
Date: 2003-05-20 14:46:40
Message-ID: 20030520074318.Q64750-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Mon, 19 May 2003, A.Bhuvaneswaran wrote:

> > I doubt it'd get tested enough to notice, if it's not in the default
> > build.
> >
> > I actually think that both of these are pretty good candidates to put
> > into 7.3.3. I'm just trying to adopt an appropriately paranoid stance
> > and ask hard questions about how much they've been tested. Between
> > Kevin and Sean it seems that the deferred-triggers change has gotten
> > enough testing to warrant some trust, but I'm not hearing anything
> > about the FK-deadlock one :-(.
> >
> > BTW, if anyone is looking for that patch, it was at
> > http://archives.postgresql.org/pgsql-hackers/2003-04/msg00260.php
>
> 7.3.2: I applied the above patch and did install and restarted postgresql,
> but the 'deadlock detected' error on FK update still exist. The below is
> the test case. Someone *advice* me, if it the above mentioned patch is not
> intended to address the below case.
>
> Test case:
>
> test_pg=# CREATE TABLE prim_test (id int primary key);
> NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
> 'prim_test_pkey'
> for table 'prim_test'
> CREATE TABLE
> test_pg=# CREATE TABLE for_test (id int references prim_test(id), name
> text);
> NOTICE: CREATE TABLE will create implicit trigger(s) for FOREIGN KEY
> check(s)
> CREATE TABLE
> test_pg=# INSERT INTO prim_test VALUES ('1');
> INSERT 4383707 1
> test_pg=# INSERT INTO prim_test VALUES ('2');
> INSERT 4383708 1
> test_pg=# INSERT INTO for_test VALUES (1, 'foo');
> INSERT 4383710 1
> test_pg=# INSERT INTO for_test VALUES (2, 'bar');
> INSERT 4383711 1
>
> t1:
> test_pg=# BEGIN ;
> BEGIN
> test_pg=# UPDATE for_test set name ='FOO' where id = 1;
> UPDATE 1
> test_pg=# UPDATE for_test set name ='Bar' where id = 2;
> UPDATE 1
>
> t2:
> test_pg=# BEGIN ;
> BEGIN
> test_pg=# UPDATE for_test set name = 'BAR' where id = 2;
> UPDATE 1
> test_pg=# UPDATE for_test set name = 'Foo' where id = 1;
> ERROR: deadlock detected

Assuming you meant interleaving those statements, that's just a garden
variety deadlock (try it again without the foreign key, it still
deadlocks).

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2003-05-20 15:02:24 Re: Feature suggestions (long)
Previous Message Georgi Chorbadzhiyski 2003-05-20 12:43:18 Re: pg_dump