truncate table adherent;
truncate table famille;
truncate table article;
truncate table market.ticket;
truncate table market.ligne;
truncate table marque;
truncate table fournisseur;

\COPY adherent FROM '/tmp/adherent.csv' (FORMAT CSV, header, ENCODING 'UTF8');
\COPY famille FROM '/tmp/famille.csv' (FORMAT CSV, header, ENCODING 'UTF8');
\COPY article FROM '/tmp/article.csv' (FORMAT CSV, header, ENCODING 'UTF8');
\COPY market.ticket FROM '/tmp/ticket.csv' (FORMAT CSV, header, ENCODING 'UTF8');
\COPY market.ligne FROM '/tmp/ligne.csv' (FORMAT CSV, header, ENCODING 'UTF8');

\COPY marque FROM '/tmp/marque.csv' (FORMAT CSV, header, ENCODING 'UTF8');
\COPY fournisseur FROM '/tmp/fournisseur.csv' (FORMAT CSV, header, ENCODING 'UTF8');
\COPY produit FROM '/tmp/produits/cereales_petitdejeuner.csv' (FORMAT CSV, header, ENCODING 'UTF8');

/*
\COPY personne(prenom, nom, telephone, ville) FROM '/tmp/personne1.csv' (FORMAT CSV, header, ENCODING 'UTF8');
\COPY societe(societe) FROM '/tmp/societe1.csv' (FORMAT CSV, header, ENCODING 'UTF8');

SELECT bank.insert_account_random(ARRAY[1]);
SELECT bank.insert_account_random(ARRAY[2]);
SELECT bank.insert_account_random(ARRAY[3]);
SELECT bank.insert_account_random(ARRAY[4]);
SELECT bank.insert_account_random(ARRAY[5],'USD');
SELECT bank.insert_account_random(ARRAY[6,11]);
*/
