Import Inherited Postgres table in dictionary

Hello all,

I am trying to play with the possibilities of creating inherited tables in Postgres.

When I import into the Clarion dictionary with ODBC, the tables and indexes of the parent table appear well.
For the inherited table, no element (column, index) is imported.
I add with Postgres a specific column in the inherited table: this one will be not imported into the dictionary either.
FYI, I am using Clarion 10, latest version.
Thanks in advance for your advice, so that the game can continue !

Clarion is going to get information about the table and its columns through ODBC calls, probably SQLTables and SQLColumns. Those will be passed to psqlODBC which will determine what to actually ask the database. You should firstly make sure you have the latest version of psqlODBC. It’s also possible that the ODBC driver doesn’t deal with inherited tables properly.

I’d suggest the following workaround. Create a view in postgres that is just select * from yourinheritedtable, and try and import that. I think that way you are more likely to get the inherited and added columns.

Thank you Jon for your reply.
Following your advice, I created a view with inherited table, and a view with parent table, but could not import both of them completely to dictionary, as inherited tables.
Tables, inherited tables and views are in the same public schema .
I have used last ODBC driver from Postgres: 17. And also v13.
All looks fine with pgAdmin, HeidiSQL and Dbeaver: inherited tables and views are perfectly read.
I will keep on searching tomorrow…
Thanks again

Hi all,
I knew that the case had to be respected with Postgres.
So, I had taken great care in naming my tables. When writing the name hBidon in Postgres, I had written hBidon in the Clarion dictionary for the table name.
This was not enough.
All table names should be written in lowercase.
Only the hbidon spelling works.
Now, with this lower case rule for table names in Postgres and Clarion dictionary, the import of inherited tables and views is easy.

1 Like

Case in Clarion for tables/columns in postgres does not matter.
What DOES matter is that when creating the tables in Postgres that you use lower case. If the tables etc are created as lowercase then referencing them is case agnostic.
I always capitalise my dct stuff, because it doesn’t matter.

thanks Sean,
i hadn’t detected this subtlety

thanks Sean,
I hadn’t detected this subtlety

Mixed case table and column names are a pain even before you add Clarion into the mix. In Postgres you would have had to write:

select *
from "hBidon"

just for your most basic query. select * from hbidon would not have worked. Sean is right in that lower/upper case in clarion table and column names makes no difference, but in Clarion you can account for mixed case naming on the server by setting the external name to “hBidon”. And if you were trying to get Clarion to create tables (a dangerous idea), Clarion would use that external name and send create table "hBidon". And yes, if you have a create table statement in postgres with anything other than lower case, even all upper case, the table name is then case-sensitive and has to be enclosed in quotes in subsequent queries.

Thank you Jon for these details.