-
Notifications
You must be signed in to change notification settings - Fork 796
Closed
Description
Describe the bug
The number displayed in the foreign table is wrong.
To Reproduce
Steps to reproduce the behavior:
- create foreign table
- For example, create foreign table foreign_table (col1 int, col2 int, col3 int) server ...
- Add comments to foreign table and columns.
- For example,
- comment on FOREIGN TABLE foreign_table IS 'foreign table';
- comment on COLUMN foreign_table.col1 IS 'col1';
- comment on COLUMN foreign_table.col2 IS 'col2';
- comment on COLUMN foreign_table.col3 IS 'col3';
Expected behavior
Only one record is displayed in the foreign table.
But three records are displayed.
Cause:
This is because condition "objsubid = 0" does not exist for table "pg_description".
pgadmin4/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/default/node.sql
pgadmin4/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/default/properties.sql
LEFT OUTER JOIN
- pg_catalog.pg_description des ON (des.objoid=c.oid AND des.classoid='pg_class'::regclass)
+ pg_catalog.pg_description des ON (des.objoid=c.oid and des.objsubid=0 AND des.classoid='pg_class'::regclass)