这是indexloc提供的服务,不要输入任何密码
Skip to content

The number displayed in the foreign table is wrong. #6279

@tokuda-takashi

Description

@tokuda-takashi

Describe the bug

The number displayed in the foreign table is wrong.

To Reproduce

Steps to reproduce the behavior:

  1. create foreign table
  • For example, create foreign table foreign_table (col1 int, col2 int, col3 int) server ...
  1. 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';

foreign_table

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)

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions