comparison src/postgres.sml @ 1428:58c9c039582a

Deal with Postgres's wonky type-changing for nullable columns of views
author Adam Chlipala <adam@chlipala.net>
date Fri, 25 Feb 2011 15:46:29 -0500
parents 0dec38af601c
children 4a6f84092399
comparison
equal deleted inserted replaced
1427:541673c3161d 1428:58c9c039582a
73 String.concatWith " OR " 73 String.concatWith " OR "
74 (map (fn (x, t) => 74 (map (fn (x, t) =>
75 String.concat ["(column_name = 'uw_", 75 String.concat ["(column_name = 'uw_",
76 CharVector.map 76 CharVector.map
77 Char.toLower (ident x), 77 Char.toLower (ident x),
78 "' AND data_type = '", 78 (case p_sql_type_base t of
79 p_sql_type_base t, 79 "bigint" =>
80 "'", 80 "' AND data_type IN ('bigint', 'numeric')"
81 | t =>
82 String.concat ["' AND data_type = '",
83 t,
84 "'"]),
81 if checkNullable then 85 if checkNullable then
82 (" AND is_nullable = '" 86 (" AND is_nullable = '"
83 ^ (if isNotNull t then 87 ^ (if isNotNull t then
84 "NO" 88 "NO"
85 else 89 else