primary key and insert

Поиск
Список
Период
Сортировка
От Marc Fromm
Тема primary key and insert
Дата
Msg-id B0D7C0A3F35FE144A70312D086CBCA9B0213C0B95D@ExchMailbox2.univ.dir.wwu.edu
обсуждение исходный текст
Ответы Re: primary key and insert
Re: primary key and insert
Re: primary key and insert
Список pgsql-admin
I created this table:
   Column   |          Type                   | Modifiers
    ------------+------------------------+------------------------
   first_name | character varying(20)  |
  last_name  | character varying(30)  |
 w_number   | character varying(9)    | 
      alert      | character varying(200) | 
  post_date  | date                           |
       id         | integer                       | not null
Indexes:
    "alert_list_pkey" PRIMARY KEY, btree (id)
I get this error when I run the insert a listed below. The insert does not have an entry for the primary key "id" since I thought it updates automatically:
Warning: pg_query() [function.pg-query]: Query failed: ERROR: null value in column "id" violates not-null constraint
 
$sql = "INSERT INTO alert_list (
                      w_number,
                      first_name,
                      last_name,
                      alert,
                      post_date
                  )
                  VALUES (
                      '$txtStudentNumber',
                      '$txtStudentFirstName',
                      '$txtStudentLastName',
                      '$txtStudentAlert',
                      'now()'
                  )";
How do I do an insert on this table and have the primary key "id" update with the record?
 
thanks
 
Marc

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