temp-table-related failure in regression tests
Is anyone else seeing this with current CVS, or is it my own breakage?
*** ./expected/alter_table.out Wed May 30 12:38:38 2001
--- ./results/alter_table.out Tue Jun 19 00:45:22 2001
***************
*** 340,347 ****
ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable(ptest1);
NOTICE: ALTER TABLE ... ADD CONSTRAINT will create implicit trigger(s) for FOREIGN KEY check(s)
DROP TABLE pktable;
! NOTICE: DROP TABLE implicitly drops referential integrity trigger from table "fktable"
! NOTICE: DROP TABLE implicitly drops referential integrity trigger from table "fktable"
DROP TABLE fktable;
CREATE TEMP TABLE PKTABLE (ptest1 int, ptest2 text,
PRIMARY KEY(ptest1, ptest2));
--- 340,347 ----
ALTER TABLE FKTABLE ADD FOREIGN KEY(ftest1) references pktable(ptest1);
NOTICE: ALTER TABLE ... ADD CONSTRAINT will create implicit trigger(s) for FOREIGN KEY check(s)
DROP TABLE pktable;
! NOTICE: DROP TABLE implicitly drops referential integrity trigger from table "pg_temp_15818_3"
! NOTICE: DROP TABLE implicitly drops referential integrity trigger from table "pg_temp_15818_3"
DROP TABLE fktable;
CREATE TEMP TABLE PKTABLE (ptest1 int, ptest2 text,
PRIMARY KEY(ptest1, ptest2));
======================================================================
regards, tom lane
I wrote:
Is anyone else seeing this with current CVS, or is it my own breakage?
Ah, the problem is RelationGetRelationName didn't know about the
new temprel naming convention.
I quick-hacked rel.h to fix this, but we need a better solution.
I don't much like having rel.h include temprel.h --- seems like the
include should go the other way. Should is_temp_relname get moved
to rel.h?
regards, tom lane
I wrote:
Is anyone else seeing this with current CVS, or is it my own breakage?
Ah, the problem is RelationGetRelationName didn't know about the
new temprel naming convention.
Sorry, yes, I missed changing that. I thought I had all the pg_temp
mapped to defines but I missed that one and hence didn't change to
underscore names.
I quick-hacked rel.h to fix this, but we need a better solution.
I don't much like having rel.h include temprel.h --- seems like the
include should go the other way. Should is_temp_relname get moved
to rel.h?
You will see near the top of rel.h:
/* added to prevent circular dependency. bjm 1999/11/15 */
extern char *get_temp_rel_by_physicalname(const char *relname);
so it seems there is an interdependency between rel.h and temprel.h.
Trying to include temprel.h in rel.h causes a compile problem. Going
the other way I assume would cause the same problem.
We can move the is_temp_relname define if you wish but with one hack
already in rel.h for get_temp_rel_by_physicalname(), I am not excited
about adding another to rel.h. In fact, is_temp_relname needs
PG_TEMP_REL_PREFIX so we would have to move it too. However, I don't
see any other solution so I moved both to from temprel.h to rel.h.
I am attaching a fix that I have committed to CVS. If you don't like
it, feel free to reverse it out and try something else. Seems to
compile fine.
I will be speaking at Red Hat HQ today so will not be available to
reverse it out myself.
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
Attachments:
/bjm/difftext/plainDownload+44-42
Bruce Momjian <pgman@candle.pha.pa.us> writes:
We can move the is_temp_relname define if you wish but with one hack
already in rel.h for get_temp_rel_by_physicalname(), I am not excited
about adding another to rel.h. In fact, is_temp_relname needs
PG_TEMP_REL_PREFIX so we would have to move it too. However, I don't
see any other solution so I moved both to from temprel.h to rel.h.
Yeah, I didn't see any other way either. With luck this whole issue
will go away when we do schemas... in the meantime at least the ugliness
is pretty localized.
regards, tom lane