Index: core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php	(revision 4bef9272bbf11b70ff9db357cd29627153579c87)
+++ core/modules/views/src/Plugin/views/relationship/RelationshipPluginBase.php	(date 1599659055554)
@@ -158,7 +158,7 @@
     $join = Views::pluginManager('join')->createInstance($id, $def);
 
     // use a short alias for this:
-    $alias = $def['table'] . '_' . $this->table;
+    $alias = $this->shortenTableAlias($def['table']) . '_' . $this->table;
 
     $this->alias = $this->query->addRelationship($alias, $join, $this->definition['base'], $this->relationship);
 
@@ -180,6 +180,22 @@
     return $dependencies;
   }
 
+  /**
+   * Shorten table name to avoid pgsql error on long alias names
+   * @param string $table_name
+   *
+   * @return string
+   */
+  private function shortenTableAlias(string $table_name) {
+    $new_alias = '';
+    foreach (explode('_', $table_name) as $word) {
+     $new_alias .= $word[0];
+    }
+
+    return !empty($new_alias) ? $new_alias : $table_name;
+
+  }
+
 }
 
 /**
