Applies to: the ODBC driver against PostgreSQL, as reported in 2021; no Clarion version is named.
Problem
A database was converted from SQL Server to PostgreSQL with a conversion tool. What happens to the dictionary: switch the driver to ODBC and use the Owner field? The poster could not get the connect string right, and an import of one table brought in the table but no fields and no keys.
Solution
- Use the ODBC driver. The connect string is different from the MS SQL one.
- A string offered in the thread:
glo:Connect = 'Driver={{PostgreSQL UNICODE};Server=server;Port=5432;Database=mydatabase;Uid=User;Pid=password;usedeclarefetch=1;'The opening brace is doubled because of Clarion's string rules, and the driver name must match exactly the name shown in the 32-bit ODBC administrator. UseDeclareFetch=1was recommended as an option for performance.- Look at schemas. The poster's converted data sat in the DBO schema while the app looked in PUBLIC; moving the one table to PUBLIC let the app open the right table. One poster only ever used the public schema; he pointed to a Stack Overflow answer on setting the PostgreSQL schema path permanently.
- Do not use the CREATE attribute on SQL tables. After the move the app created a second table with the same name in PUBLIC.
Caveats
- The poster did not report back after the schema step, so the thread does not show a finished connection.
- A poster advised thinking about schemas for security: the default setup puts new tables under the database owner, which he called a security risk for a business program. He gave roles or a separate schema holding the permissions as the pattern.
- A second poster said he no longer uses CREATE with any table, TPS included, after files were recreated with data in them.
Today (2026)
Likely unchanged; the driver name must still match the ODBC administrator on your machine. Not re-tested.
Sources: Antonio D. (Jan 2021, the question), Sean H., Jon W., Andre L. (Jan 2021) in softvelocity.clarion.databasedrivers.