Follow these steps to test concurrent index creation:
- Connect to the pgbench database and execute the following command as a superuser or the postgres user:
CREATE INDEX CONCURRENTLY idx_account_bid ON pgbench_accounts (bid);
- In another connection, attempt to execute the following insert before the preceding command completes:
INSERT INTO pgbench_accounts VALUES (50000000, 100, 15000, 'testing');