|
35 | 35 | # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
36 | 36 | # SUCH DAMAGE. |
37 | 37 | # |
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 $ |
40 | 40 |
|
41 | 41 | # TODO: |
42 | 42 | # + Handle SETs |
|
47 | 47 |
|
48 | 48 | # |
49 | 49 | # $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> |
52 | 58 | # |
53 | 59 | # Revision 1.21 2001/08/25 18:55:28 fonin |
54 | 60 | # Incorporated changes from Yunliang Yu <yu@math.duke.edu>: |
|
141 | 147 | $|=1; |
142 | 148 |
|
143 | 149 | print("------------------------------------------------------------------"); |
144 | | -print("\n-- My2Pg\$Revision: 1.5 $\translated dump"); |
| 150 | +print("\n-- My2Pg\$Revision: 1.6 $\translated dump"); |
145 | 151 | print("\n--"); |
146 | 152 | print("\n------------------------------------------------------------------"); |
147 | 153 |
|
|
163 | 169 | # push header to libtypes.c |
164 | 170 | open(LIBTYPES,">$libtypesource"); |
165 | 171 | print LIBTYPES"/******************************************************"; |
166 | | -print LIBTYPES"\n * My2Pg\$Revision: 1.5 $\translated dump"; |
| 172 | +print LIBTYPES"\n * My2Pg\$Revision: 1.6 $\translated dump"; |
167 | 173 | print LIBTYPES"\n * User types definitions"; |
168 | 174 | print LIBTYPES"\n ******************************************************/"; |
169 | 175 | print LIBTYPES"\n\n#include <postgres.h>\n"; |
|
627 | 633 | $tmpfld=~s/\s*,\s*/","/gif$dq; |
628 | 634 | $index{$table_name}[++$j]="CREATE INDEX${ky}_$table_name\_index ON$dq$table_name$dq ($dq$tmpfld$dq);"; |
629 | 635 | } |
630 | | -if(/^\s*UNIQUE([\w\d_]+)\s*\((.*)\).*/i) { |
| 636 | +if(/^\s*UNIQUE.*?([\w\d_]+)\s*\((.*)\).*/i) { |
631 | 637 | my$tmpfld=$2;my$ky=$1; |
632 | 638 | $tmpfld=~s/,/","/gif$dq; |
633 | 639 | $index{$table_name}[++$j]="CREATE UNIQUE INDEX${ky}_$table_name\_index ON$dq$table_name$dq ($dq$tmpfld$dq);"; |
|
694 | 700 |
|
695 | 701 | open(MAKE,">Makefile"); |
696 | 702 | print MAKE"# |
697 | | -# My2Pg\$Revision: 1.5 $\translated dump |
| 703 | +# My2Pg\$Revision: 1.6 $\translated dump |
698 | 704 | # Makefile |
699 | 705 | # |
700 | 706 |
|
@@ -908,6 +914,7 @@ =head1 CREDITS |
908 | 914 | Jeff Waugh <jaw@ic.net> |
909 | 915 | Joakim Lemström <jocke@bytewize.com> || <buddyh19@hotmail.com> |
910 | 916 | Yunliang Yu <yu@math.duke.edu> |
| 917 | +Brad Hilton <bhilton@vpop.net> |
911 | 918 |
|
912 | 919 | =head1LICENSE |
913 | 920 |
|
|