Re: [HACKERS] Arrays broken on temp tables - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Arrays broken on temp tables
Date
Msg-id 3271.941927629@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Arrays broken on temp tables  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] Arrays broken on temp tables  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <maillist@candle.pha.pa.us> writes:
> Well, I now wonder whether I did the right thing in adding temp tables
> the way I did.  Is there a better way.

I don't think there's anything wrong with the basic temp table design.
We've just discovered an oversight: given a Relation entry, there's no
way to get back the original table name, and sometimes you need to.

I'm inclined to think that RelationGetRelationName should be replaced
by two access macros: one to give back the "physical" rel name (same
as the current macro) and one to give back the "logical" name, which'd
be different in the case of a temp table.  We'd need to extend relcache
entries to include the logical name as an additional field.  Then we'd
need to look at all the uses of RelationGetRelationName to see which
ones should be which.  There might be some direct accesses to
rel->rd_rel->relname as well :-( which need to be found and fixed.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Ryan Kirkpatrick
Date:
Subject: Re: [HACKERS] PostgreSQL 6.5.3 built, but not released ...
Next
From: Keith Parks
Date:
Subject: Re: [HACKERS] New psql compile problem.