3

Comments are a useful way to annotate database objects such as fields and tables in PostgreSQL. A comment on a table is written like this:

COMMENT ON TABLE table IS 'QGIS has no issues reading table-level comments from PostgreSQL.';

They show up as comments when a PostgreSQL layer is loaded in QGIS, as evidenced in the Information pane:

QGIS information pane screenshot

QGIS also shows field-level comments in the Field pane:

enter image description here

My question is, does ArcGIS Pro have the same capability? When I load the layer there, the 'table metadata' shows up as blank:

ArcGIS doesn't show the metadata

I might not be looking in the correct place, but I'm not seeing where else it might be hiding.

Alternatively, is there another method to include PostgreSQL comments when loading layers into ArcGIS Pro?

2

Not the most elegant solution, but it's possible to create a view from any table and write a field comment into a field by referencing where it is in the table. Hoping there's something better out there.

select pk,geom,col_description('schema.table'::regclass::oid, 1) from schema.table limit 1
-2
+50

I know that I'm missing something perfectly obvious. If you have a PostgreSQL table field named "comments" (or "notes", or whatever), its contents will of course display, like any other PostgreSQL table field. What am I missing? BTW, object names in PostgreSQL (databases, schemas, tables, fields, ...) should be in lower case so double-quoting those names is not necessary.

3
  • Double quoting which names? All of the fields are lower case. Seems very convoluted and inefficient to write those comments to a table which then have to take up space on a row-by-row level. – Encomium May 29 at 19:47
  • I think PostgreSQL COMMENTs can only be viewed with psql \d commands, or by accessing the built-in COMMENT object commands: postgresql.org/docs/12/…. – Rudy Stricklan May 29 at 21:06
  • QGIS shows psql comments as table and field metadata. – Encomium May 29 at 21:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.