From 5c2890c9e47abe2cbdbc95dafdbe9007d99e99a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20R=C3=B6ssler?= Date: Fri, 22 Oct 2021 11:38:33 +0200 Subject: [PATCH] PostgreReflector: fix reflection of matview columns on PostgreSQL 12+ --- src/Dibi/Drivers/PostgreReflector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Dibi/Drivers/PostgreReflector.php b/src/Dibi/Drivers/PostgreReflector.php index fff271e4..066e1394 100644 --- a/src/Dibi/Drivers/PostgreReflector.php +++ b/src/Dibi/Drivers/PostgreReflector.php @@ -100,7 +100,7 @@ public function getColumns(string $table): array a.atttypmod-4 AS character_maximum_length, NOT a.attnotnull AS is_nullable, a.attnum AS ordinal_position, - adef.adsrc AS column_default + pg_get_expr(adef.adbin, adef.adrelid) AS column_default FROM pg_attribute a JOIN pg_type ON a.atttypid = pg_type.oid