[Debutant]Probleme d'insert sur sequence !
Bonjour à tous !
Voila j'ai un probleme. ça vous l'aviez deviné, y'en a qui commence a avoir l'habitude avec moi lol.
Lorsque que je fais un insert sur un table francais dont voici le code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| CREATE TABLE francais
(
id_antiquaire serial NOT NULL,
client bool NOT NULL DEFAULT false,
nom_antiquaire varchar(50) NOT NULL,
nom_boutique varchar(100) NOT NULL,
adresse_boutique varchar(130) NOT NULL,
id_village int4 NOT NULL,
telephone varchar(10) NOT NULL,
fax varchar(10),
mobile varchar(10),
email varchar(150),
site varchar(150),
valide bool NOT NULL DEFAULT false,
date_saisie date NOT NULL,
no_departement varchar(3),
id_prestation int4,
CONSTRAINT pk_francais1 PRIMARY KEY (id_antiquaire),
CONSTRAINT fk_francais2 FOREIGN KEY (no_departement) REFERENCES departement (no_departement) ON UPDATE RESTRICT ON DELETE RESTRICT
)
WITHOUT OIDS;
ALTER TABLE francais OWNER TO postgres;
GRANT ALL ON TABLE francais TO postgres;
GRANT ALL ON TABLE francais TO public; |
Voici mon insert :
Code:
1 2
|
INSERT INTO francais (client, nom_antiquaire, ..., id_prestation) VALUES (FALSE, 'Prenom De L\'anitquaire Nom De L\'antiquaire', ..., 0) |
Il me signale que la sequence n'existe pas !!
Citation:
ERROR: relation "public.francais_id_antiquaire_seq" does not exist
Pourtant, un serial cré automatiquement une sequence !!
Quelqu'un pourrait me dire pourquoi ca ne fonctionne pas, j'aimerais éviter de créer la séquence.
Merci beaucoup d'avance[/code]