diff options
author | Thomas G. Lockhart | 2001-01-18 07:16:56 +0000 |
---|---|---|
committer | Thomas G. Lockhart | 2001-01-18 07:16:56 +0000 |
commit | b890cd6bd56e0ba1f241da7d6e319978c89be49a (patch) | |
tree | 561f4ac216efdc5c7b407e50999f75c2dfee065c | |
parent | fdb833d708e2fa2e40cd62f1314d84a8bea3e976 (diff) |
Add "--nodata" option to allow schema conversion only.
-rwxr-xr-x | contrib/mysql/mysql2pgsql | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/contrib/mysql/mysql2pgsql b/contrib/mysql/mysql2pgsql index 0f73b0a27e..a51dfde53e 100755 --- a/contrib/mysql/mysql2pgsql +++ b/contrib/mysql/mysql2pgsql @@ -15,11 +15,12 @@ use Getopt::Long; my $progname = "mysql2pgsql"; my $version = "0.3"; -GetOptions("debug!", "verbose!", "version", "path=s", "help"); +GetOptions("debug!", "verbose!", "version", "path=s", "help", "data!"); my $debug = $opt_debug || 0; my $verbose = $opt_verbose || 0; my $pathfrom = $opt_path || ""; +my $nodata = (! $opt_data); $pathfrom = "$pathfrom/" if ($pathfrom =~ /.*[^\/]$/); @@ -29,12 +30,15 @@ print "\t(c) 2000 Thomas Lockhart PostgreSQL Inc.\n" if ($opt_version && $opt_verbose || $opt_help); if ($opt_help) { - print "$0 --verbose --version --help --path=dir infile ...\n"; + print "$0 --verbose --version --help --path=dir --nodata infile ...\n"; exit; } while (@ARGV) { my $ostem; + my $oname; + my $pname; + my @xargs; $iname = shift @ARGV; $ostem = $iname; @@ -44,7 +48,10 @@ while (@ARGV) { $oname = "$ostem.sql92"; $pname = "$ostem.init"; - print "$iname $oname $pname\n" if ($debug); + @xargs = ($iname, $oname); + push @xargs, $pname unless ($nodata); + + print "@xargs\n" if ($debug); TransformDumpFile($iname, $oname, $pname); } @@ -68,7 +75,7 @@ sub TransformDumpFile { push @dlines, $_; } - print "Calling CreateSchema with $#dlines lines\n" if ($debug); + print("Calling CreateSchema with $#dlines lines\n") if ($debug); @slines = CreateSchema(@dlines); open(OUT, ">$oname") || die "Unable to open output file $oname"; |