未验证 提交 387bf9cd 编写于 作者: J Jinbao Chen 提交者: GitHub

Fixed the \dm empty output error

The psql client ignored rel storage when he create the \dm command.
So the output of \dm was empty. Add the correct rel storage check in command
上级 0da92fbc
...@@ -3741,7 +3741,7 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys ...@@ -3741,7 +3741,7 @@ listTables(const char *tabtypes, const char *pattern, bool verbose, bool showSys
if (isGPDB()) /* GPDB? */ if (isGPDB()) /* GPDB? */
{ {
appendPQExpBuffer(&buf, "AND c.relstorage IN ("); appendPQExpBuffer(&buf, "AND c.relstorage IN (");
if (showTables || showIndexes || showSeq || (showSystem && showTables)) if (showTables || showIndexes || showSeq || (showSystem && showTables) || showMatViews)
appendPQExpBuffer(&buf, "'h', 'a', 'c',"); appendPQExpBuffer(&buf, "'h', 'a', 'c',");
if (showExternal) if (showExternal)
appendPQExpBuffer(&buf, "'x',"); appendPQExpBuffer(&buf, "'x',");
......
drop role if exists matview_ao_role;
create role matview_ao_role;
set role matview_ao_role;
CREATE TABLE t_matview_ao (id int NOT NULL PRIMARY KEY, type text NOT NULL, amt numeric NOT NULL); CREATE TABLE t_matview_ao (id int NOT NULL PRIMARY KEY, type text NOT NULL, amt numeric NOT NULL);
INSERT INTO t_matview_ao VALUES INSERT INTO t_matview_ao VALUES
(1, 'x', 2), (1, 'x', 2),
...@@ -104,3 +107,25 @@ SELECT * FROM m_aocs; ...@@ -104,3 +107,25 @@ SELECT * FROM m_aocs;
x | 5 x | 5
(3 rows) (3 rows)
\dm m_heap
List of relations
Schema | Name | Type | Owner
--------+--------+-------------------+-----------------
public | m_heap | materialized view | matview_ao_role
(1 row)
\dm m_ao
List of relations
Schema | Name | Type | Owner
--------+------+-------------------+-----------------
public | m_ao | materialized view | matview_ao_role
(1 row)
\dm m_aocs
List of relations
Schema | Name | Type | Owner
--------+--------+-------------------+-----------------
public | m_aocs | materialized view | matview_ao_role
(1 row)
RESET role;
drop role if exists matview_ao_role;
create role matview_ao_role;
set role matview_ao_role;
CREATE TABLE t_matview_ao (id int NOT NULL PRIMARY KEY, type text NOT NULL, amt numeric NOT NULL); CREATE TABLE t_matview_ao (id int NOT NULL PRIMARY KEY, type text NOT NULL, amt numeric NOT NULL);
INSERT INTO t_matview_ao VALUES INSERT INTO t_matview_ao VALUES
(1, 'x', 2), (1, 'x', 2),
...@@ -40,3 +44,8 @@ SELECT * FROM m_aocs; ...@@ -40,3 +44,8 @@ SELECT * FROM m_aocs;
REFRESH MATERIALIZED VIEW m_aocs; REFRESH MATERIALIZED VIEW m_aocs;
SELECT * FROM m_aocs; SELECT * FROM m_aocs;
\dm m_heap
\dm m_ao
\dm m_aocs
RESET role;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册