Pour vos révisions vous pouvez utiliser les scripts et la base de données dans ce répertoire. Avec docker, il convient de procéder comme suit : On redémmare notre ancien container $ docker restart some-postgres some-postgres On lance le psql: $ docker run -it --link some-postgres:postgres --rm onjin/alpine-postgres sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres' psql (9.5.6) Type "help" for help. postgres=# On obtient l’identifiant du container : $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d67346af81e9 onjin/alpine-postgres "/docker-entrypoint.…" 15 minutes ago Up 15 minutes 5432/tcp relaxed_booth 9367e89f03e6 onjin/alpine-postgres "/docker-entrypoint.…" 4 months ago Up 31 minutes 5432/tcp some-postgres On copie les fichiers dans le container: $ docker cp distribution1.txt d67346af81e9:/tmp $ docker cp personne1.txt d67346af81e9:/tmp $ docker cp acteur1.txt d67346af81e9:/tmp $ docker cp passe1.txt d67346af81e9:/tmp $ docker cp salle1.txt d67346af81e9:/tmp $ docker cp Controle.sql d67346af81e9:/tmp $ docker cp film1.txt d67346af81e9:/tmp $ docker cp reponses.sql d67346af81e9:/tmp On peut charger le script Controle.sql qui génère la base de données postgres=# \i /tmp/Controle.sql SET SET psql:/tmp/Controle.sql:5: NOTICE: drop cascades to constraint passe2_numf_fkey on table passe2 DROP TABLE DROP TABLE DROP TABLE DROP TABLE psql:/tmp/Controle.sql:9: NOTICE: drop cascades to constraint passe2_numc_fkey on table passe2 DROP TABLE psql:/tmp/Controle.sql:10: NOTICE: drop cascades to constraint salle2_nums_fkey on table salle2 DROP TABLE DROP TABLE CREATE TABLE CREATE TABLE CREATE TABLE CREATE TABLE CREATE TABLE CREATE TABLE CREATE TABLE COPY 4 COPY 6 COPY 6 COPY 3 COPY 4 COPY 4 COPY 4 postgres=# \d List of relations Schema | Name | Type | Owner --------+---------------+-------+---------- public | acteur2 | table | postgres public | cinema | table | postgres public | cinema2 | table | postgres public | distribution2 | table | postgres public | film | table | postgres public | film2 | table | postgres public | individu | table | postgres public | jouer | table | postgres public | passe2 | table | postgres public | personne2 | table | postgres public | projection | table | postgres public | salle2 | table | postgres (12 rows) postgres=# Et maintenant on peut lancer les requêtes : postgres=# \i /tmp/reponses.sql count ------- 7 (1 row) numc | nums | numf | longueur | titre | genre | annee | budget | realisateur | salairereal | datedeb | datefin | horaires | prix | tailleecran | nbplaces ------+------+------+----------+--------------+----------+------------+---------+-------------+-------------+------------+------------+----------+------+-------------+---------- 1 | 10 | 3 | 120 | Pulp Fiction | Policier | 01/01/1994 | 1750000 | Bernard | 67000 | 01/01/1995 | 10/10/1995 | 18:30:00 | 7.5 | 200 | 650 3 | 12 | 5 | 92 | Dogville | Drame | 01/01/2002 | 500000 | Jacques | 50000 | 01/01/1997 | 10/10/1997 | 18:30:00 | 8.5 | 195 | 500 (2 rows) genre | count -------+------- (0 rows) titre ---------- Dogville (1 row) titre ----------- Super Man (1 row) titre | annee --------------------+------------ Breaking the waves | 01/01/1996 (1 row) postgres=#