Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Privilege for creating PK-FK relationship
"Richard Foote" <richard.foote_at_bigpond.com> wrote in message
news:VbJ09.45722$Hj3.138697_at_newsfeeds.bigpond.com...
> Hi Stjepan,
>
> Check out the References object privilege.
>
> Cheers
>
> Richard
> "Stjepan Brbot" <stjepan.brbot_at_zg.hinet.hr> wrote in message
> news:ahvekj$cjcm$2_at_as201.hinet.hr...
> > I'd like to create PK-FK relationship between two tables from different
> > schemas. If parent table is in my own schema and child table in another
> > schema, what kind of privileges (minimal) I have to have on this child
> > table in another schema to create mentioned relationship?
> >
> > --
> >
> > Stjepan Brbot
> >
> >
> >
>
References is indeed pertinent here.
If the parent table were in the other schema, then to create a FK constraint
in my schema, all that would be required is for the owner of the other
schema to grant references on the parent table to me.
But I'm not sure whether Richard has noted that it's the other way round. Whoever actually creates this constraint , the constraint itself will reside in the 'other' schema, as a FK constraint 'belongs' to the table being constrained; i.e. the child.
So I think that the correct answer to the question actually being asked is ALTER on the child table. But unless there was a good reason, I think that as Stjepan, I'd grant references on his parent table to the other account, then have the other account create the constraint.
Sorry this was somewhat long-winded.
Paul Received on Sun Jul 28 2002 - 12:13:01 CDT
![]() |
![]() |