/[sql]/mysql2pgsql
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /mysql2pgsql

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by dpavlin, Tue Apr 25 13:48:56 2000 UTC revision 1.4 by dpavlin, Tue Apr 25 14:02:47 2000 UTC
# Line 62  while(<DUMP>) { Line 62  while(<DUMP>) {
62                          if (/^\s*(\w+)\s+/) {                          if (/^\s*(\w+)\s+/) {
63                                  $seq="${table}_${1}_seq";                                  $seq="${table}_${1}_seq";
64                                  push @sequences,"$table.$1";                                  push @sequences,"$table.$1";
65                                  s/\w*int.*auto_increment/int4 default nextval('$seq') not null/ig;                                  s/(\w+) \w*int.*auto_increment/$1 int4 default nextval('$seq') not null/ig;
66                          } else {                          } else {
67                                  die "can't get name of field!";                                  die "can't get name of field!";
68                          }                          }
# Line 157  foreach $seq (@sequences) { Line 157  foreach $seq (@sequences) {
157          print STDERR "$sql\n";          print STDERR "$sql\n";
158          $sth = $dbh->prepare($sql) || die $dbh->errstr();          $sth = $dbh->prepare($sql) || die $dbh->errstr();
159          $sth->execute() || die $sth->errstr();          $sth->execute() || die $sth->errstr();
160          ($start) = $sth->fetchrow_array();          ($start) = $sth->fetchrow_array() || 1;
161    
162          $seq="${table}_${field}_seq";          $seq="${table}_${field}_seq";
163    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.26