PostgreSQL doens't support the ADD PRIMARY KEY sql function. (I am actually working on a patch at the moment to enable this - it should be in 7.2)
However, you can do this instead:
CREATE UNIQUE INDEX "test_pkey" ON test(id);
Plus, the "id" column in the "test" table MUST be NOT NULL for it to be a proper Primary Key.
You can then modify the pg_index table and set its entry to 'indisprimary' if you like.
Chris