I followed a tutorial to create a PostgreSQL lookup table with the following schema:
CREATE TABLE public.link_categories
(
id integer NOT NULL DEFAULT nextval('link_categories_id_seq'::regclass),
name character varying(16) NOT NULL,
description text,
CONSTRAINT link_categories_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
ALTER TABLE public.link_categories
OWNER TO postgres;
As I understand it, the first field is a numerical "sequence" key that doesn't need to be populated; it just automatically fills with numerals as I add or delete rows.
I want to fill the second field with data from a spreadsheet, and I have nothing to put in the third field at the moment.
So I copied the one field I want to import into a new spreadsheet, then added a field on either side of it. So I have a three-column table with data in the center column only. I then saved it as a CSV file.
When I try to import it, I get the following error:
WARNING: null value in column "id" violates non-null constraint
How can I fill this table with data from one CSV file, using PostgreSQL 9.5 and pgAdmin III?