Mercurial > urweb
comparison src/postgres.sml @ 1958:4ef0c6605b3a
Postgres: look up table names case-sensitively in catalog
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Wed, 15 Jan 2014 14:54:26 -0500 |
parents | 0992323fa264 |
children | 661b531f55bd |
comparison
equal
deleted
inserted
replaced
1957:ef9fdbb05c73 | 1958:4ef0c6605b3a |
---|---|
66 val sl = if size sl > 1 andalso String.sub (sl, 0) = #"\"" then | 66 val sl = if size sl > 1 andalso String.sub (sl, 0) = #"\"" then |
67 String.substring (sl, 1, size sl - 2) | 67 String.substring (sl, 1, size sl - 2) |
68 else | 68 else |
69 sl | 69 sl |
70 | 70 |
71 val q = "SELECT COUNT(*) FROM information_schema." ^ table ^ " WHERE LOWER(table_name) = '" | 71 val q = "SELECT COUNT(*) FROM information_schema." ^ table ^ " WHERE table_name = '" |
72 ^ sl ^ "'" | 72 ^ sl ^ "'" |
73 | 73 |
74 val q' = String.concat ["SELECT COUNT(*) FROM information_schema.columns WHERE table_name = '", | 74 val q' = String.concat ["SELECT COUNT(*) FROM information_schema.columns WHERE table_name = '", |
75 sl, | 75 sl, |
76 "' AND (", | 76 "' AND (", |