This project is archived and is in readonly mode.
add_index on postgresql with long index names: migrations fail with Input string is longer than NAMEDATALEN-1 (63)
-
CancelProfileIsBroken
- Tag changed from 2.3.4, add_index, migrations, postgresql to 2.3.4, add_index, bugmash, migrations, postgresql
-
Sebastian A. Espindola
This work has bitten me to.
I verified the same behaviour with the postgres driver
when trying to create a 4 fields long composite index.
I'm working on a patch to truncate index names to the max
identifier size.Will have it uploaded in a couple hours.
-
Ben Woodcroft
For me, the same thing occurs for remove_index, presumably for the same reason. As with add_index, using the :name option worked around it.
-
Ben Woodcroft
- Tag changed from 2.3.4, add_index, bugmash, migrations, postgresql to 2.3.4, 2.3.5, add_index, bugmash, migrations, postgresql
still true as of 2.3.5
-
Matt Jones
There's a more general issue where the AR adapters don't have any details about the various adapter's limits; see #3452 for a patch I'm working on to clean up the behavior of add_index and friends. It needs some rewriting, but could be useful in cases like this.
BTW, is there a coherent place where these limits are defined for PG? I had a heck of a time trying to find documentation for any of the supporting DBs that actually specified hard limits.
-
Rizwan Reza
- Tag changed from 2.3.4, 2.3.5, add_index, bugmash, migrations, postgresql to 2.3.4, 2.3.5, add_index, migrations, postgresql
-
Incite
You can find PG defaults in pg_config_manual.h which should generally be available since you need postgres headers to install the gem. Specifically, NAMEDATALEN
-
Jeremy Kemper
- State changed from new to duplicate