summaryrefslogtreecommitdiff
path: root/lib/Catmandu/Store/DBI/Handler/Pg.pm
diff options
context:
space:
mode:
authorNicolas Franck <nicolas.franck@ugent.be>2024-03-20 15:59:59 +0100
committerNicolas Franck <nicolas.franck@ugent.be>2024-03-20 15:59:59 +0100
commit46827c3b9eaec65dd82fc4629904e1dcdd666aea (patch)
treedc4a7729392ba2d24a0eb0c021b6c72f87da149d /lib/Catmandu/Store/DBI/Handler/Pg.pm
parentb27d141d92887e013ede2f996e3859fd2e616c18 (diff)
auto discover current schema, and create indexes on that schema
Diffstat (limited to 'lib/Catmandu/Store/DBI/Handler/Pg.pm')
-rw-r--r--lib/Catmandu/Store/DBI/Handler/Pg.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Catmandu/Store/DBI/Handler/Pg.pm b/lib/Catmandu/Store/DBI/Handler/Pg.pm
index af6178a..0f1e82a 100644
--- a/lib/Catmandu/Store/DBI/Handler/Pg.pm
+++ b/lib/Catmandu/Store/DBI/Handler/Pg.pm
@@ -66,10 +66,10 @@ IF NOT EXISTS (
FROM pg_class c
JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE c.relname = '${name}_${col}_idx'
- AND n.nspname = 'public'
+ AND n.nspname = (SELECT CURRENT_SCHEMA)
) THEN
- CREATE INDEX ${name}_${col}_idx ON public.${name} (${q_col});
+ CREATE INDEX ${name}_${col}_idx ON ${name} (${q_col});
END IF;
END\$\$;