Composite Keys

Поиск
Список
Период
Сортировка
От RPK
Тема Composite Keys
Дата
Msg-id 9131229.post@talk.nabble.com
обсуждение исходный текст
Ответы Re: Composite Keys  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: Composite Keys  (Jorge Godoy <jgodoy@gmail.com>)
Список pgsql-general
First, can a primary key field be only one? I mean can I define a primary
containing two fields.

I have a table called "Payments" where there are two fields, "ReceiptNo" and
"PaymentDate". If I take "ReceiptNo" only as a primary key then chances are
of "primary key violation". Because in some places the receipt books have
numbers that start with 1. I mean Receipt Book 1 nos. 1-100. Receipt Book 2
nos. 1-100, and so on.

So I want to take ReceiptNo and PaymentDate as primary key field. Is it
possible to define composite key in PGSQL. Please also suggest if any other
approach would be fine.
--
View this message in context: http://www.nabble.com/Composite-Keys-tf3282722.html#a9131229
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


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

Предыдущее
От: RPK
Дата:
Сообщение: Re: Installing PGSQL Client
Следующее
От: CaT
Дата:
Сообщение: Re: postgresql vs mysql