]> xenbits.xensource.com Git - osstest.git/commitdiff
mg-schema-test-database: posgtres compat: Cope with schema name
authorIan Jackson <iwj@xenproject.org>
Tue, 27 Apr 2021 17:46:40 +0000 (18:46 +0100)
committerIan Jackson <iwj@xenproject.org>
Tue, 27 Apr 2021 17:57:48 +0000 (18:57 +0100)
The dump now (postgresql 11) contains lots of "public." which made
these regexps not match.

Signed-off-by: Ian Jackson <iwj@xenproject.org>
mg-schema-test-database

index b49fbecf6984307a56b20756e80359a584427f4c..b5906d7067c524c27062b7c9a8542858e966abc4 100755 (executable)
@@ -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;