Installation of Kickstart RC1 fails on PostgreSQL 9.1 during the "Install Demo Store" phase. This appears to be caused by this issue: #1214846: Table names might be too long for PostgreSQL. The fix there does nothing to solve the problem, it just trims the length. There will still be collisions of similar names if they get that long.

Here's the error I get.

SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "search_api_db_product_display_field_product_commerce_price_amou" already exists

I'm not using a database prefix or suffix.

Comments

bendiy’s picture

Search API DB is trying to stick these together and fails:
"search_api_db_product_display_" + "field_product_commerce_price_amount_float_asc"

Maybe that field name can be shortened.

suckerpunch’s picture

One fix is to recompile Postgres.

Download and decompress the source code, src/include/pg_config_manual.h with the NAMEDATALEN set to a high value, like 1024. There is a 63 character limit in Postgres by default for table names.

Section of file:

/*
 * Maximum length for identifiers (e.g. table names, column names,
 * function names).  Names actually are limited to one less byte than this,
 * because the length must include a trailing zero byte.
 *
 * Changing this requires an initdb.
 */
#define NAMEDATALEN 1024

Then recompile as usual (configure, make, etc).

jsacksick’s picture

Status: Active » Fixed
xatoo’s picture

Status: Fixed » Active

Forcing people to recompile PostgreSQL is not my definition of 'fixed'.

jaredsmith’s picture

I agree -- forcing the user to recompile PostgreSQL with a special flag is not "fixed".

bendiy’s picture

Every PostgreSQL security and bugfix minor release will then have to be patched and recompiled. This is a bad thing to do to your users. Especially given the recent PostgreSQL security hole.
http://www.postgresql.org/support/security/faq/2013-04-04/

Can we consider having some shorter naming conventions?
http://stackoverflow.com/questions/3836247/how-do-i-change-the-namedatal...

insanely_stupid_and_totally_impractical_table_or_function_name0 // Does not need to exist.
search_api_db_prod_dsp_field_prod_comm_price_amt // Could work, but just kicks the can down the road.

I think Drupal needs to break the convention of:

my_module_name_your_module_name_field_name_plus_some_more_stuff_table

How do we do that? I'm not sure yet...

jsacksick’s picture

Project: Commerce Kickstart » Search API
Version: 7.x-2.0-rc1 » 7.x-1.x-dev
Component: Code » Framework
Status: Active » Closed (duplicate)

The issue has to be fixed in Search API itself, marking this as a duplicate of #1214846: Table names might be too long for PostgreSQL