From 2cb490b853f6d8bf6e44aabbc962f05dae832343 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 27 Apr 2021 18:46:40 +0100 Subject: [PATCH] mg-schema-test-database: posgtres compat: Cope with schema name The dump now (postgresql 11) contains lots of "public." which made these regexps not match. Signed-off-by: Ian Jackson --- mg-schema-test-database | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mg-schema-test-database b/mg-schema-test-database index b49fbecf..b5906d70 100755 --- a/mg-schema-test-database +++ b/mg-schema-test-database @@ -377,9 +377,10 @@ END # What tables are there ? perl -ne <$t.schema >$t.tablevars ' - if (m/^CREATE SEQUENCE (\w+)/) { + BEGIN { $sch_re = qr{(?:public\.)?}; } + if (m/^CREATE SEQUENCE $sch_re(\w+)/) { print "sequences+=\" $1\"\n"; - } elsif (m/^CREATE TABLE (\w+)/) { + } elsif (m/^CREATE TABLE $sch_re(\w+)\s+/) { $table=$1; } elsif (m/^\s*flight\s+integer\s/) { die unless $table; -- 2.39.5