From 2aaf030a92d71720e34f79b46784a004f6afe875 Mon Sep 17 00:00:00 2001 From: Matthew Bucci Date: Wed, 21 Feb 2024 20:22:04 -0800 Subject: [PATCH] correct function to get primary key --- pg4wp/driver_pgsql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pg4wp/driver_pgsql.php b/pg4wp/driver_pgsql.php index f6dad2d..184609f 100644 --- a/pg4wp/driver_pgsql.php +++ b/pg4wp/driver_pgsql.php @@ -473,7 +473,7 @@ function get_primary_key_for_table(&$connection, $table) FROM pg_index i JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey) - WHERE i.indrelid = 'tablename'::regclass + WHERE i.indrelid = '$table'::regclass AND i.indisprimary SQL;