Where to start First steps track · 15 stages
Linux Labs

Web stack

Quiz: PostgreSQL

Question 7 of 10
Leave the quiz

Read the output

Yesterday's dump was restored straight into the working shop. Why did the new order fail?

$ pg_restore -d shop shop.dump
…
pg_restore: warning: errors ignored on restore: 9
$ psql -d shop -c 'SELECT count(*) FROM orders'
     6
$ psql -d shop -c 'INSERT INTO orders (customer_id, amount) VALUES (1, 10)'
ERROR:  duplicate key value violates unique constraint "orders_pkey"
DETAIL:  Key (id)=(6) already exists.
Back A–D or ↵ Sign in to answer
Loading…