On Thu, 29 Dec 2016 17:23:48 -0500, "'John Clements' via Racket Users" <racket-users@googlegroups.com> wrote:
> >> On Dec 28, 2016, at 12:51, David Storrs <david.sto...@gmail.com> wrote: >> >> There's also this: >> >> (query-rows db >> " >> SELECT column_name >> FROM information_schema.columns >> WHERE table_schema = 'your_schema' >> AND table_name = 'your_table' >> “) > >I’m guessing that that one’s postgresql-only, especially given the >‘table_schema’ element. The format of the "system catalog" is implementation defined. There is no common convention for naming system tables - every vendor does things (at least a little) differently. Correspondingly, there is no portable way to query the catalog. ODBC (and JDBC) provides functions to query the most commonly needed catalog information, but if you need something it does not provide - e.g., to look up table constraints - you have to figure out how to get that information yourself. The DB lib does return table header information in the rows-result structure. To get it you have to use the generic (query) rather than one of the more specific query forms. Perhaps DB should provide additional abstract catalog functions. At least equivalent to those that ODBC provides: https://msdn.microsoft.com/en-us/library/ms711722(v=vs.85).aspx George -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.