simulate multiple primary keys

Поиск
Список
Период
Сортировка
От Brandon Metcalf
Тема simulate multiple primary keys
Дата
Msg-id Pine.LNX.4.58L.0907021223180.6476@cedar.geronimoalloys.com
обсуждение исходный текст
Ответы Re: simulate multiple primary keys
Re: simulate multiple primary keys
Список pgsql-general
I have the following table:

  gms=> \d jobclock
                                              Table "public.jobclock"
     Column    |              Type              |                           Modifiers
  -------------+--------------------------------+----------------------------------------------------------------
   jobclock_id | integer                        | not null default nextval('jobclock_jobclock_id_seq'::regclass)
   employee_id | integer                        | not null
   machine_id  | character varying(4)           | not null
   workorder   | character varying(8)           | not null
   operation   | integer                        | not null
   bartype     | character varying(10)          | not null
   clockin     | timestamp(0) without time zone | not null
   clockout    | timestamp(0) without time zone | default NULL::timestamp without time zone
   comments    | character varying(255)         | default NULL::character varying
  Indexes:
      "jobclock_pkey" PRIMARY KEY, btree (jobclock_id)
  ...

I need to keep jobclock_id unique and not null, but I also need to
ensure that no row is duplicated.  Is my best bet to drop the current
primary key and make a primary key out of the columns that I want to
ensure remain unique from row to row?

Thanks.


--
Brandon

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

Предыдущее
От: "James B. Byrne"
Дата:
Сообщение: PG_DUMP/RESTORE Would like an explanation of these (non-critical) errors
Следующее
От: "Hartman, Matthew"
Дата:
Сообщение: Re: simulate multiple primary keys