Re: Information about columns
От | Dario Teixeira |
---|---|
Тема | Re: Information about columns |
Дата | |
Msg-id | 977541.74858.qm@web111503.mail.gq1.yahoo.com обсуждение исходный текст |
Ответ на | Information about columns (Dario Teixeira <darioteixeira@yahoo.com>) |
Ответы |
Re: Information about columns
|
Список | pgsql-general |
Hi, > Why do you think that's a useful activity for client-side > code to engage in? Strongly typed languages like Ocaml and Haskell deal with the possibility of missing values by having "option types". Though at first glance SQL's NULL seems like a similar concept, in fact NULL is more like a constraint on a table column instead of defining a different type. This impedance mismatch causes some trouble when writing bindings that aim to preserve type-safety. I doubt there is a clean way around this (barring Postgresql implementing option types). Therefore, I'm working on a workaround that involves the Postgresql side annotating the nullability of type definitions by issuing comments on the type (using COMMENT ON). Yes, it is a hack, but will solve my problem as long as I can determine the return type (and thus fetch its comment) associated with a query. I know other people faced this problem before when writing Ocaml or Haskell bindings, and that is why I know there is no straightforward solution. Still, I welcome any thinking-outside-the-box suggestions... Cheers, Dario Teixeira
В списке pgsql-general по дате отправления: