Re: primary key and uniqueness
Posted in 2000
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! ;-)
> >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?
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?
Thanks!!
--
"And I'm happy, because you make me feel good, about me." - Melvin Udall
-----------------------------------------------------------------
Mart'n Marqu's email: martin@math.unl.edu.ar
Santa Fe - Argentina http://math.unl.edu.ar/~martin/
Administrador de sistemas en math.unl.edu.ar
-----------------------------------------------------------------