From 7b2f3e285687742f0f13cec0b4680d1252bdb1e9 Mon Sep 17 00:00:00 2001 From: Julien Rouhaud Date: Tue, 6 Dec 2016 19:24:23 +0100 Subject: [PATCH 1/2] Fix parsing of conf_file --- sqlserver2pgsql.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlserver2pgsql.pl b/sqlserver2pgsql.pl index 425fea2..f37466c 100755 --- a/sqlserver2pgsql.pl +++ b/sqlserver2pgsql.pl @@ -101,7 +101,7 @@ sub parse_conf_file while (my $line = ) { $line =~ s/#.*//; # Remove comments - $line =~ s/\s+=\s+//; # Remove whitespaces around the = + $line =~ s/\s+=\s+/=/; # Remove whitespaces around the = $line =~ s/\s+$//; # Remove trailing whitespaces next if ($line =~ /^$/); # Empty line after comments have been removed From bb8d9b50783fc226e7494d3ad0c81688c0e4cd9c Mon Sep 17 00:00:00 2001 From: Julien Rouhaud Date: Tue, 6 Dec 2016 19:36:14 +0100 Subject: [PATCH 2/2] Use non greedy modifier in constraint square bracket handling. --- sqlserver2pgsql.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqlserver2pgsql.pl b/sqlserver2pgsql.pl index f37466c..b37cba0 100755 --- a/sqlserver2pgsql.pl +++ b/sqlserver2pgsql.pl @@ -1853,7 +1853,7 @@ sub parse_dump } $constraint->{TYPE} = 'CHECK'; $constxt =~ - s/\[(\S+)\]/$1/g; # We remove the []. And hope this will parse + s/\[(\S+?)\]/$1/g; # We remove the []. And hope this will parse $constraint->{TEXT} = $constxt; push @{$objects->{SCHEMAS}->{$schema}->{'TABLES'}->{$table}->{CONSTRAINTS}}, ($constraint);