diff 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
line wrap: on
line diff
--- a/src/postgres.sml	Fri Feb 25 11:27:16 2011 -0500
+++ b/src/postgres.sml	Fri Feb 25 15:46:29 2011 -0500
@@ -75,9 +75,13 @@
                                                            String.concat ["(column_name = 'uw_",
                                                                           CharVector.map
                                                                               Char.toLower (ident x),
-                                                                          "' AND data_type = '",
-                                                                          p_sql_type_base t,
-                                                                          "'",
+                                                                          (case p_sql_type_base t of
+                                                                               "bigint" =>
+                                                                               "' AND data_type IN ('bigint', 'numeric')"
+                                                                             | t =>
+                                                                               String.concat ["' AND data_type = '",
+                                                                                              t,
+                                                                                              "'"]),
                                                                           if checkNullable then
                                                                               (" AND is_nullable = '"
                                                                                ^ (if isNotNull t then