root/bin/my2pg.data @ 5600
1 | 4428 | aaronmk | #!/bin/sh
|
---|---|---|---|
2 | # Translates a MySQL data-only DB export to PostgreSQL
|
||
3 | # The export must be created with:
|
||
4 | # `--compatible=postgresql --add-locks=false --set-charset --no-create-info`
|
||
5 | # Usage: self {input...|<input} >translated
|
||
6 | |||
7 | sedEreFlag="$(test "$(uname)" = Darwin && echo E || echo r)" |
||
8 | |||
9 | sed () { "$(which sed)" -"$sedEreFlag" "$@";} |
||
10 | |||
11 | sed \ |
||
12 | 4455 | aaronmk | -e "s/'0000-00-00'/'-infinity'/g" \ |
13 | 4428 | aaronmk | "$@" |