primary key and insert - Mailing list pgsql-admin

From Marc Fromm
Subject primary key and insert
Date
Msg-id B0D7C0A3F35FE144A70312D086CBCA9B0213C0B95D@ExchMailbox2.univ.dir.wwu.edu
Whole thread Raw
Responses Re: primary key and insert  (Steve Crawford <scrawford@pinpointresearch.com>)
Re: primary key and insert  (johnf <jfabiani@yolo.com>)
Re: primary key and insert  (Suresh Borse <s.borse@direction.biz>)
List 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 by date:

Previous
From: AmitKumar Jain
Date:
Subject: Re: Tool to converter plsql in pgplsql
Next
From: Steve Crawford
Date:
Subject: Re: primary key and insert