Skip to content

Commit f88aa2d

Browse files
committed
Update my2pg to version 1.22.
1 parent 6d6b3e9 commit f88aa2d

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

contrib/mysql/my2pg.pl

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3636
# SUCH DAMAGE.
3737
#
38-
# $My2pg: my2pg.pl,v 1.21 2001/08/25 18:55:28 fonin Exp $
39-
# $Id: my2pg.pl,v 1.5 2001/11/21 02:43:30 momjian Exp $
38+
# $My2pg: my2pg.pl,v 1.22 2001/12/06 19:32:20 fonin Exp $
39+
# $Id: my2pg.pl,v 1.6 2002/01/07 22:36:51 momjian Exp $
4040

4141
# TODO:
4242
# + Handle SETs
@@ -47,8 +47,14 @@
4747

4848
#
4949
# $Log: my2pg.pl,v $
50-
# Revision 1.5 2001/11/21 02:43:30 momjian
51-
# Update my2pg.pl for release.
50+
# Revision 1.6 2002/01/07 22:36:51 momjian
51+
# Update my2pg to version 1.22.
52+
#
53+
# Revision 1.22 2001/12/06 19:32:20 fonin
54+
# Patch: On line 594 where you check for UNIQUE, I believe the regex should try
55+
# and match 'UNIQUE KEY'. Otherwise it outputs no unique indexes for the
56+
# postgres dump.
57+
# Thanks to Brad Hilton <bhilton@vpop.net>
5258
#
5359
# Revision 1.21 2001/08/25 18:55:28 fonin
5460
# Incorporated changes from Yunliang Yu <yu@math.duke.edu>:
@@ -141,7 +147,7 @@
141147
$|=1;
142148

143149
print("------------------------------------------------------------------");
144-
print("\n-- My2Pg \$Revision: 1.5 $ \translated dump");
150+
print("\n-- My2Pg \$Revision: 1.6 $ \translated dump");
145151
print("\n--");
146152
print("\n------------------------------------------------------------------");
147153

@@ -163,7 +169,7 @@
163169
# push header to libtypes.c
164170
open(LIBTYPES,">$libtypesource");
165171
print LIBTYPES "/******************************************************";
166-
print LIBTYPES "\n * My2Pg \$Revision: 1.5 $ \translated dump";
172+
print LIBTYPES "\n * My2Pg \$Revision: 1.6 $ \translated dump";
167173
print LIBTYPES "\n * User types definitions";
168174
print LIBTYPES "\n ******************************************************/";
169175
print LIBTYPES "\n\n#include <postgres.h>\n";
@@ -627,7 +633,7 @@
627633
$tmpfld=~s/\s*,\s*/","/g if $dq;
628634
$index{$table_name}[++$j]="CREATE INDEX ${ky}_$table_name\_index ON $dq$table_name$dq ($dq$tmpfld$dq);";
629635
}
630-
if(/^\s*UNIQUE ([\w\d_]+)\s*\((.*)\).*/i) {
636+
if(/^\s*UNIQUE.*?([\w\d_]+)\s*\((.*)\).*/i) {
631637
my $tmpfld=$2; my $ky=$1;
632638
$tmpfld=~s/,/","/g if $dq;
633639
$index{$table_name}[++$j]="CREATE UNIQUE INDEX ${ky}_$table_name\_index ON $dq$table_name$dq ($dq$tmpfld$dq);";
@@ -694,7 +700,7 @@
694700

695701
open(MAKE,">Makefile");
696702
print MAKE "#
697-
# My2Pg \$Revision: 1.5 $ \translated dump
703+
# My2Pg \$Revision: 1.6 $ \translated dump
698704
# Makefile
699705
#
700706
@@ -908,6 +914,7 @@ =head1 CREDITS
908914
Jeff Waugh <jaw@ic.net>
909915
Joakim Lemström <jocke@bytewize.com> || <buddyh19@hotmail.com>
910916
Yunliang Yu <yu@math.duke.edu>
917+
Brad Hilton <bhilton@vpop.net>
911918
912919
=head1 LICENSE
913920

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy