> Rules aren't affected, because they refer to tables by OID
> always.
Ah, that's good. I hadn't tried that variation because I don't really
use rules that much other than select rules for views.
> > Or, you might be able to make a case that you CANNOT shadow a table
> > that is referenced by a constraint (due to the permanent table
constraints
> > cannot reference a temporary table restriction). Since the creation of
> > the temp table would break the restriction, it is illegal.
>
> Good point. What does the standard say about it? Can a table,
> referred to by foreign key constraints or referential
> actions, be shadowed by a temp table?
Well, that's the question. I don't see anything in the spec saying that it
can't precisely. It's a question of wording on the rules about the
constraint.
11.8 Syntax rule 4 Case a)
If the referencing table is a permanent base table, then the referenced
table
shall be a persistant base table.
So, if you shadowed the table by a temp table, would this no longer be true
(and therefore the create is illegal) or are you supposed to imply that you
still reference the persistant base table despite the fact it is shadowed?
I'd
guess the latter because it's a syntax rule (I had thought it was a general
rule until I went to look it up).