Re: primary key and uniqueness
Posted in 2000
From: "Martin A. Marques" <martin@math.unl.edu.ar>
>
>On Fri, 23 Jun 2000, you wrote:
> > From: "Martin A. Marques" <martin@math.unl.edu.ar>
> > >
> > >Is it posible to create a table like this
> > >
> > >CREATE TABLE usuario (
> > > U_id SERIAL PRIMARY KEY UNIQUE,
> > > U_nombre NCHAR(50),
> > >);> >
> > I don't know. Is it? Have you tried it? What happened?
>
>Got an error! ;-)
Perfectly reasonable error too!
> > >The question would be if I can combine "PRIMARY KEY" with "UNIQUE". Can
>I
> > >make any kind of combination of constraints?
> >
> > In this case PRIMARY KEY includes UNIQUE, so why would you want to? In
>fact,
> > this produces error 577 "this type of constraint already exists on this
> > column set". So, technically, the answer to your question is no.
>
>So with PRIMARY KEY I get it all! Do I get some other constraint?
In what way?
>One last one. Is it posible to reference a field on a table to a field on
>another table that is not a PRIMARY KEY?
No. Not using declarative syntax, anyway.
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com