High Performance PostgreSQL for Rails: creating index (p. 60)

Hi,

I’m reading chapter 3 (B8.0), in particular the part about cloning sequences and indexes to the scrubbed tables. This part confused me:

Let’s take a look at the UNIQUE index on the users.email column. To create that
index again, you’d run the following statement to create on the users_copy table:

-- Temporarily adding "2" to the index name,
-- so that it's unique (can remove the "2" later)
CREATE UNIQUE INDEX index_users_on_email2
ON users USING btree (email);

Would this not just create a new index on the original table, instead of the users_copy table like I want? Have I missed something, or is this a typo?

Cheers

1 Like