Re: Primary Keys

Поиск
Список
Период
Сортировка
От Thomas F. O'Connell
Тема Re: Primary Keys
Дата
Msg-id 3AEED298.2080804@monsterlabs.com
обсуждение исходный текст
Список pgsql-general
Brian Z wrote:

> How can you create a Primary Key which contains multiple columns on for a
> table.

first of all, i recommend checking out the syntax for the CREATE TABLE
command. it's available here:

http://postgresql.readysetnet.com/users-lounge/docs/7.1/postgres/sql-createtable.html

for a quick example, though:

create table foo (
    bar int4,
    baz int4,
    ola int4,
    primary key( bar, baz )
);

this statement will make the columns bar and baz coincidentally the
primary key for the table foo.

-tfo


В списке pgsql-general по дате отправления:

Предыдущее
От: "Christian Marschalek"
Дата:
Сообщение: Serial Type
Следующее
От: "Eric G. Miller"
Дата:
Сообщение: Improve a query...