High Performance PostgreSQL for Rails: Issue with bulk_load.sh

Hi and thank you for this fantastic book,

I ran in the following error while trying to run db/scripts/bulk_load.sh:

Bulk loading 10_000_000 Drivers and Riders
Raising the statement_timeout
ERROR:  syntax error at or near "_000_000"
LINE 19: FROM GENERATE_SERIES(1, 10_000_000) seq;

I manage to get the scrip running by removing the underscores from the 10 million e.g.:
FROM GENERATE_SERIES(1, 10000000) seq; instead of:
FROM GENERATE_SERIES(1, 10_000_000) seq;

Hope this helps,

Yann

1 Like

Thanks! Support for underscores was added in PostgreSQL 16. Can you confirm you were running that version?
I’ll re-test to confirm though and add an extra note. In most cases code snippets don’t rely on 16 and will work on much older versions.

This make sense, I’m running PostgreSQL 13!

1 Like

Sounds good. I added a comment indicating that PostgreSQL 16 is required, in case others miss that.