Project

General

Profile

« Previous | Next » 

Revision 10237

bin/my2pg*: keep MySQL indefinite dates as text strings instead of translating them (to the first of the month or year) to fit into a PostgreSQL timestamp. this allows the application to decide how to handle these values, which otherwise have no corresponding value in PostgreSQL. this requires changing the date/time related types to text instead of leaving them as-is, so that they can store the custom MySQL strings.

View differences:

my2pg.data
10 10
echo 'SET escape_string_warning = off;'
11 11
sed \
12 12
-e 's/([^\\](\\\\)*)\\0/$10/g' \
13
-e "s/'0000-00-00( 00:00:00)?'/'-infinity'/g" \
14
-e "s/('[[:digit:]]{4}-)00(-[[:digit:]]{2}')/\101\2/g" \
15
-e "s/('[[:digit:]]{4}-[[:digit:]]{2}-)00(')/\101\2/g" \
16 13
"$@"
17 14
# \0 isn't allowed in UTF-8; note that \ is doubled for sed

Also available in: Unified diff