summaryrefslogtreecommitdiff
path: root/src/postgres.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-02-25 15:46:29 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2011-02-25 15:46:29 -0500
commit7ff3e5339ed2ba17c022e190bcb8cbb579188c89 (patch)
treecc6c641e4fc676b2057f7fdbf662ae69ed8ca19d /src/postgres.sml
parent36d3dc318f697a28e725ad6512f827af268f6532 (diff)
Deal with Postgres's wonky type-changing for nullable columns of views
Diffstat (limited to 'src/postgres.sml')
-rw-r--r--src/postgres.sml10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/postgres.sml b/src/postgres.sml
index 7209f34a..70360163 100644
--- a/src/postgres.sml
+++ b/src/postgres.sml
@@ -75,9 +75,13 @@ fun checkRel (table, checkNullable) (s, xts) =
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