Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2669658

Browse files
author
Thomas G. Lockhart
committed
Add "--nodata" option to allow schema conversion only.
1 parentb06fbc7 commit2669658

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

‎contrib/mysql/mysql2pgsql

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ use Getopt::Long;
1515
my$progname ="mysql2pgsql";
1616
my$version ="0.3";
1717

18-
GetOptions("debug!","verbose!","version","path=s","help");
18+
GetOptions("debug!","verbose!","version","path=s","help","data!");
1919

2020
my$debug =$opt_debug || 0;
2121
my$verbose =$opt_verbose || 0;
2222
my$pathfrom =$opt_path ||"";
23+
my$nodata = (!$opt_data);
2324

2425
$pathfrom ="$pathfrom/"if ($pathfrom =~/.*[^\/]$/);
2526

@@ -29,12 +30,15 @@ print "\t(c) 2000 Thomas Lockhart PostgreSQL Inc.\n"
2930
if ($opt_version &&$opt_verbose ||$opt_help);
3031

3132
if ($opt_help) {
32-
print"$0 --verbose --version --help --path=dir infile ...\n";
33+
print"$0 --verbose --version --help --path=dir--nodatainfile ...\n";
3334
exit;
3435
}
3536

3637
while (@ARGV) {
3738
my$ostem;
39+
my$oname;
40+
my$pname;
41+
my@xargs;
3842

3943
$iname =shift@ARGV;
4044
$ostem =$iname;
@@ -44,7 +48,10 @@ while (@ARGV) {
4448
$oname ="$ostem.sql92";
4549
$pname ="$ostem.init";
4650

47-
print"$iname$oname$pname\n"if ($debug);
51+
@xargs = ($iname,$oname);
52+
push@xargs,$pnameunless ($nodata);
53+
54+
print"@xargs\n"if ($debug);
4855

4956
TransformDumpFile($iname,$oname,$pname);
5057
}
@@ -68,7 +75,7 @@ sub TransformDumpFile {
6875
push@dlines,$_;
6976
}
7077

71-
print"Calling CreateSchema with$#dlines lines\n"if ($debug);
78+
print("Calling CreateSchema with$#dlines lines\n")if ($debug);
7279
@slines = CreateSchema(@dlines);
7380

7481
open(OUT,">$oname") ||die"Unable to open output file$oname";

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp