From: | Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp> |
Cc: | pgsql-hackers(at)postgreSQL(dot)org |
Subject: | Re: [HACKERS] temp table oddness? |
Date: | 1999-09-04 14:57:53 |
Message-ID: | 199909041457.KAA18485@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> I found weird behavior with temp tables.
>
> test=> create table u1(i int);
> CREATE
> test=> insert into u1 values(1);
> INSERT 3408201 1
> test=> insert into u1 values(1);
> INSERT 3408202 1
> test=> create temp table u1(i int primary key);
> NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'u1_pkey' for table 'u1'
> NOTICE: trying to delete a reldesc that does not exist.
> NOTICE: trying to delete a reldesc that does not exist.
> CREATE
>
> Are these notices normal?
Not normal. This works:
test=> create table u1(i int);
CREATE
test=> insert into u1 values(1);
INSERT 18697 1
test=> insert into u1 values(1);
INSERT 18698 1
test=> create temp table u1(i int);
CREATE
test=> create unique index i_u1 on u1(i);
CREATE
Backtrace shows:
#0 elog (lev=0,
fmt=0x81700e7 "trying to delete a reldesc that does not exist.")
at elog.c:75
#1 0x812a1f6 in RelationFlushRelation (relationPtr=0x8043510,
onlyFlushReferenceCountZero=0) at relcache.c:1262
#2 0x812a6c8 in RelationPurgeLocalRelation (xactCommitted=1 '\001')
at relcache.c:1533
#3 0x8086c3f in CommitTransaction () at xact.c:954
#4 0x8086e2c in CommitTransactionCommand () at xact.c:1172
#5 0x80ff559 in PostgresMain (argc=4, argv=0x80475a8, real_argc=4,
real_argv=0x80475a8) at postgres.c:1654
#6 0x80b619c in main (argc=4, argv=0x80475a8) at main.c:102
#7 0x80607fc in __start ()
What I don't understand why the PRIMARY is different than creating the
index manually... OK, got the reason:
test=> create table u1(i int);
CREATE
test=> insert into u1 values(1);
INSERT 18889 1
test=> insert into u1 values(1);
INSERT 18890 1
test=> begin;
BEGIN
test=> create temp table u1(i int);
CREATE
test=> create unique index i_u1 on u1(i);
CREATE
test=> end;
NOTICE: trying to delete a reldesc that does not exist.
NOTICE: trying to delete a reldesc that does not exist.
END
The cause is that the index creation is happening in the same
transaction as the create of the temp table. Any comments on a cause?
Tom Lane's cache changes may address this.
--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 1999-09-04 15:08:23 | Re: [HACKERS] array manipulations |
Previous Message | Tatsuo Ishii | 1999-09-04 14:04:31 | temp table oddness? |