Code : Tout sélectionner
CREATE TABLE referentiel_spatial
(
ref_spa_id serial NOT NULL,
ref_spa_nom varchar(100),
CONSTRAINT referentiel_spatial_pkey PRIMARY KEY (ref_spa_id)
)
WITHOUT OIDS;
ALTER TABLE referentiel_spatial OWNER TO postgres;
Code : Tout sélectionner
Column: ref_spa_id
-- ALTER TABLE referentiel_spatial DROP COLUMN ref_spa_id;
ALTER TABLE referentiel_spatial ADD COLUMN ref_spa_id int4;
ALTER TABLE referentiel_spatial ALTER COLUMN ref_spa_id SET STORAGE PLAIN;
ALTER TABLE referentiel_spatial ALTER COLUMN ref_spa_id SET NOT NULL;
ALTER TABLE referentiel_spatial ALTER COLUMN ref_spa_id SET DEFAULT nextval('referentiel_spatial_ref_spa_id_seq'::regclass);Mon id s'auto-increment étant donné qu'il est serial.