> CREATE TABLE books (
> id SERIAL PRIMARY KEY,
>
> Which has the advantage of not having to manually create the sequences. Will
> this also enforce that the "internally created sequence" will be initialized
> to a value above the maximum key in use on a pg_restore?
I think you will still run into the same issue if your sequence is not getting the proper value as max(id) or max(id) +1, not sure which is actually needed. You may get some benefits from using IDENTITY rather than the pseudo-type of serial, as described in this blog post-
Still, depending on how you are doing the data restore, you may need something like this to ensure the sequence is updated.
select setval( 'table_id_seq', ( select max(id) + 1 from table ) );