[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OSSTEST PATCH 3/7] 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 <iwj@xxxxxxxxxxxxxx>
---
 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.20.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.