|
|||||||||||
|
Re: [ADMIN] Primary key
From: Richard Broersma Jr <rabroersma(at)yahoo.com>
Date: Wed Sep 19 2007 - 11:26:15 EDT
> Does postgres allow compound or composite keys for primary keys? I It does. composite key are defined as a table constraint: http://www.postgresql.org/docs/8.2/interactive/sql-createtable.html This link illistrates syntax with this example: CREATE TABLE films (
code char(5),
title varchar(40),
did integer,
date_prod date,
kind varchar(10),
len interval hour to minute,
CONSTRAINT code_title PRIMARY KEY(code,title)
);
Regards,
---------------------------(end of broadcast)---------------------------TIP 2: Don't 'kill -9' the postmaster Received on Wed Sep 19 11:28:29 2007 This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 12:16:06 EDT |
||||||||||
|
|||||||||||