From d9c4b8132f86cf9aee748ed9d8ccdaa22f2d4639 Mon Sep 17 00:00:00 2001 From: Mark Donnelly Date: Mon, 27 Apr 2015 15:44:49 -0400 Subject: [PATCH] Limit the identifier names to 63 characters. PostgreSQL comes with a compile-time default maximum length of 63 characters for identifier names. If we take the DataObjects default of 128 characters, then PostgreSQL will 'helpfully' and silently truncate our identifier name (say, the name of a constraint) upon creation. This has an unfortunate effect of making any subsequent call to manipulate the object identified by more than 63 characters fail, since the object by the longer name does not exist. So, limit this to 63 characters. --- lib/dm-postgres-adapter/adapter.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/dm-postgres-adapter/adapter.rb b/lib/dm-postgres-adapter/adapter.rb index 67720c1..f319c89 100644 --- a/lib/dm-postgres-adapter/adapter.rb +++ b/lib/dm-postgres-adapter/adapter.rb @@ -7,6 +7,8 @@ module Adapters class PostgresAdapter < DataObjectsAdapter module SQL #:nodoc: + IDENTIFIER_MAX_LENGTH = 63 + private # @api private