| From: | Greg Stark <gsstark(at)mit(dot)edu> | 
|---|---|
| To: | "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com> | 
| Cc: | Greg Stark <gsstark(at)mit(dot)edu>, Brendan Duddridge <brendan(at)clickspace(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Performance <pgsql-performance(at)postgresql(dot)org> | 
| Subject: | Re: App very unresponsive while performing simple update | 
| Date: | 2006-06-01 04:30:46 | 
| Message-ID: | 87hd35ijk9.fsf@stark.xeocode.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-performance | 
"Jim C. Nasby" <jnasby(at)pervasive(dot)com> writes:
> I tried duplicating this but couldn't. What's the data in the tables?
Sorry, I had intended to include the definition and data:
stark=> create table t1 (a integer primary key, b integer);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for table "t1"
CREATE TABLE
stark=> create table t2 (a integer, b integer primary key);
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "t2_pkey" for table "t2"
CREATE TABLE
stark=> insert into t1 values (1,2);
INSERT 0 1
stark=> insert into t2 values (1,2);
INSERT 0 1
stark=> alter table t1 add constraint fk foreign key (b) references t2 deferrable initially deferred ;
ALTER TABLE
stark=> alter table t2 add constraint fk foreign key (a) references t1 deferrable initially deferred ;
ALTER TABLE
stark=> \d t1
      Table "public.t1"
 Column |  Type   | Modifiers 
--------+---------+-----------
 a      | integer | not null
 b      | integer | 
Indexes:
    "t1_pkey" PRIMARY KEY, btree (a)
Foreign-key constraints:
    "fk" FOREIGN KEY (b) REFERENCES t2(b) DEFERRABLE INITIALLY DEFERRED
stark=> \d t2
      Table "public.t2"
 Column |  Type   | Modifiers 
--------+---------+-----------
 a      | integer | 
 b      | integer | not null
Indexes:
    "t2_pkey" PRIMARY KEY, btree (b)
Foreign-key constraints:
    "fk" FOREIGN KEY (a) REFERENCES t1(a) DEFERRABLE INITIALLY DEFERRED
stark=> select * from t1;
 a | b 
---+---
 1 | 2
(1 row)
stark=> select * from t2;
 a | b 
---+---
 1 | 2
(1 row)
-- 
greg
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Antoine | 2006-06-01 11:54:08 | vacuuming problems continued | 
| Previous Message | Jim C. Nasby | 2006-06-01 03:18:05 | Re: App very unresponsive while performing simple update |