Re: Foreign key bugs + other problems - Mailing list pgsql-hackers

From Stephan Szabo
Subject Re: Foreign key bugs + other problems
Date
Msg-id 025d01bfeb83$61fee0c0$0c64010a@kick.com
Whole thread Raw
In response to Re: Foreign key bugs + other problems  (JanWieck@t-online.de (Jan Wieck))
List pgsql-hackers
>     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).




pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Foreign key bugs + other problems
Next
From: Tom Lane
Date:
Subject: Re: Foreign key bugs + other problems