From 5d8e871068b06290e038e81068623ebb5d43a95a Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Fri, 25 Feb 2011 15:46:29 -0500 Subject: Deal with Postgres's wonky type-changing for nullable columns of views --- src/postgres.sml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/postgres.sml') 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 -- cgit v1.2.3