 INSERT INTO calendar (id, name, calendar_type) VALUES (3,'cal 3','brique');
 INSERT INTO calendar (id, name, calendar_type) VALUES (4,'cal 4','brique');
 INSERT INTO calendar (id, name, calendar_type) VALUES (5,'cal 5','brique');
-SELECT pg_catalog.setval('calendar_id_seq', 6, true);
+INSERT INTO calendar (id, name, calendar_type) VALUES (6,'cal 6','brique');
+SELECT pg_catalog.setval('calendar_id_seq', 7, true);
 
 SELECT insertcalendarelement(3,'2015-01-01','2015-02-01',1, '+'); -- ca marche
 SELECT insertcalendarelement(1,NULL,NULL,1, '+', 3); -- ca marche : les calendriers 1 et 3 doivent être '2015-01-01','2015-02-01'

-- A3. Suppression d'élément de telle sorte qu'un élément '-' arrive au premier rang

-- création calendriers
INSERT INTO calendar (id, name, calendar_type) VALUES (1,'je suis vide','periode') ;
INSERT INTO calendar (id, name, calendar_type) VALUES (2,'je vais etre rempli','periode') ;
SELECT pg_catalog.setval('calendar_id_seq', 3, true);

-- remplissages cal 2 (le cal 1 reste vide)

SELECT getcalendarbitmask(5,'2015-01-05','2015-02-05'); -- ca marche : ça donne : "11111000000000000000000000000000" 


SELECT insertcalendarelement(6,'2015-01-01','2015-03-01',2, '+'); -- les start end sont à '2015-01-01','2015-02-28'
SELECT insertcalendarelement(6,'2015-01-02','2015-03-01',2, '&'); -- les start end sont à NULL
SELECT getcalendarbitmask(6,'2015-01-01','2015-03-01'); -- vaut "000000000000000000000000000000000000000000000000000000000000"

