Problem/Motivation
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42883]: Undefined function: 7 ERROR: function unix_timestamp(character varying) does not exist LINE 7: ...id" = '1') AND ("a"."status" = 'completed') AND ((UNIX_TIMES... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts.: SELECT COUNT(*) AS "expression" FROM (SELECT 1 AS "expression" FROM "opigno_learning_path_achievements" "a" INNER JOIN "groups" "g" ON g.id = a.gid WHERE ("a"."uid" = :db_condition_placeholder_0) AND ("a"."status" = :db_condition_placeholder_1) AND ((UNIX_TIMESTAMP(a.completed) >= :timestamp))) "subquery"; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => completed [:timestamp] => 1634270400 ) in Drupal\opigno_statistics\Services\UserStatisticsManager->getUserTrainingsNumberByStatus() (line 171 of modules/contrib/opigno_statistics/src/Services/UserStatisticsManager.php).
Drupal\Core\Database\StatementWrapper->execute(Array, Array) (Line: 874)
Drupal\Core\Database\Connection->query('SELECT COUNT(*) AS "expression"
FROM
(SELECT 1 AS "expression"
FROM
{opigno_learning_path_achievements} "a"
INNER JOIN {groups} "g" ON g.id = a.gid
WHERE ("a"."uid" = :db_condition_placeholder_0) AND ("a"."status" = :db_condition_placeholder_1) AND ((UNIX_TIMESTAMP(a.completed) >= :timestamp))) "subquery"', Array, Array) (Line: 183)
Drupal\Core\Database\Driver\pgsql\Connection->query('SELECT COUNT(*) AS "expression"
FROM
(SELECT 1 AS "expression"
FROM
{opigno_learning_path_achievements} "a"
INNER JOIN {groups} "g" ON g.id = a.gid
WHERE ("a"."uid" = :db_condition_placeholder_0) AND ("a"."status" = :db_condition_placeholder_1) AND ((UNIX_TIMESTAMP(a.completed) >= :timestamp))) "subquery"', Array, Array) (Line: 512)
Drupal\Core\Database\Query\Select->execute() (Line: 147)
Drupal\Core\Database\Driver\pgsql\Select->execute() (Line: 171)
Drupal\opigno_statistics\Services\UserStatisticsManager->getUserTrainingsNumberByStatus(7, 1) (Line: 416)
Drupal\opigno_statistics\Services\UserStatisticsManager->renderUserStatistics(7, 1) (Line: 1393)
Drupal\opigno_statistics\Controller\UserController->index(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 578)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 158)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 80)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 67)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 717)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Steps to reproduce
Found this with a d9 install with postgres and went to /user/1