| От | Rafael Charnovscki |
|---|---|
| Тема | Varchar or integer primary key? |
| Дата | |
| Msg-id | 4105569E.4010101@unesc.rct-sc.br обсуждение |
| Ответы |
Re: Varchar or integer primary key?
Re: Varchar or integer primary key? |
| Список | pgsql-novice |
I have a 6-digit integer number for a patient identifier which I intend to use as a primary key (PK) for a table. It also will be a foreign key in other tables. Do I have to use an integer data type as a domain for this PK or could I use a varchar(6)? Is there any difference between an index on an integer column and one on a varchar column? I've been searching the internet and books for something to help on this question but I haven't found. There are lot of good discussions on choosing primary keys but nothing related to my issue. Any suggestions or references may help. Thanks in advance, Rafael
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера