KuKeC
KuKeC

Reputation: 4610

Export Progress OpenEdge column description as table comment in PostgreSQL

I have managed to export database structure from Progress Open Edge to PostgreSQL but without any column comments. Since lots of tools for migrating are limited with functionality I was thinking about making SQL code myself. So now I'm thinking about looping thru all tables and columns in my database "data" and generating SQL code like below

COMMENT ON COLUMN public.table_name.table_column IS 'Value from PROGRESS';

Since I'm not familiar with any system tables in Progress I'm asking for guidance for looping thru all tables and columns in my database "data" and getting values from picture below

values wanted

Upvotes: 0

Views: 577

Answers (2)

user330315
user330315

Reputation:

The following query works for me:

select col as column_name, 
       description as comment
from sysprogress.syscolumns_full
where tbl = 'TheTable';

Upvotes: 1

Jensd
Jensd

Reputation: 8011

The "Virtual system tables" you are possibly what your are looking for.

_Field (for fields) and _File (for tables).

Very short example:

SELECT * FROM PUB."_File" where "_Tbl-Type" = 'T'

Taken from this Knowledgebase article:

https://knowledgebase.progress.com/articles/Article/P43044

Also there's lots of more information in the documentation around the different Virtual System Tables. Start here:

https://www.progress.com/documentation/openedge

Upvotes: 1

Related Questions