Skip to content

Commit

Permalink
Add support for user-defined data types
Browse files Browse the repository at this point in the history
Related issue: #323
  • Loading branch information
vitalca committed Nov 7, 2022
1 parent c24be29 commit c71caeb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tds_fdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -3413,7 +3413,11 @@ tdsImportSybaseSchema(ImportForeignSchemaStmt *stmt, DBPROCESS *dbproc,
appendStringInfoString(&buf,
"SELECT so.name AS table_name, "
" sc.name AS column_name, "
" st.name AS data_type, "
" CASE WHEN st.usertype < 100 "
" THEN st.name "
" ELSE (SELECT s1.name FROM dbo.systypes s1 WHERE s1.usertype = "
" (SELECT min(s2.usertype) FROM dbo.systypes s2 WHERE s2.type = st.type)) "
" END AS data_type, "
" SUBSTRING(sm.text, 10, 255) AS column_default, "
" CASE (sc.status & 0x08) "
" WHEN 8 THEN 'YES' ELSE 'NO' "
Expand Down

0 comments on commit c71caeb

Please sign in to comment.