This is an automated email from the ASF dual-hosted git repository.
chenjinbao1989 pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/cbdb-postgres-merge by this
push:
new 23659c11add Fix psql errors
23659c11add is described below
commit 23659c11add01a421085b7a8c2f1d5fc0daeeb32
Author: Jinbao Chen <[email protected]>
AuthorDate: Wed Nov 26 22:32:49 2025 +0800
Fix psql errors
---
src/bin/psql/describe.c | 22 ++++++------
src/test/regress/expected/misc.out | 4 ++-
src/test/regress/expected/stats_ext.out | 62 ---------------------------------
src/test/regress/expected/tidscan.out | 13 +------
src/test/regress/serial_schedule | 12 +++----
src/test/regress/sql/misc.sql | 2 ++
src/test/regress/sql/psql.sql | 6 ----
src/test/regress/sql/stats_ext.sql | 18 ----------
8 files changed, 23 insertions(+), 116 deletions(-)
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 7e783c153dd..60b7e3dea0f 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4607,18 +4607,13 @@ describeRoles(const char *pattern, bool verbose, bool
showSystem)
" r.rolcreaterole, r.rolcreatedb,
r.rolcanlogin,\n"
" r.rolconnlimit, r.rolvaliduntil");
+ /* add Cloudberry specific attributes */
+ appendPQExpBufferStr(&buf, "\n, r.rolcreaterextgpfd");
+ appendPQExpBufferStr(&buf, "\n, r.rolcreatewextgpfd");
+ appendPQExpBufferStr(&buf, "\n, r.rolcreaterexthttp");
+
if (verbose)
{
- /* add Cloudberry specific attributes */
- appendPQExpBufferStr(&buf, "\n, r.rolcreaterextgpfd");
- appendPQExpBufferStr(&buf, "\n, r.rolcreatewextgpfd");
- appendPQExpBufferStr(&buf, "\n, r.rolcreaterexthttp");
-
- if (isGPDB7000OrLater())
- {
- appendPQExpBufferStr(&buf, "\n, r.rolenableprofile");
- }
-
appendPQExpBufferStr(&buf, "\n,
pg_catalog.shobj_description(r.oid, 'pg_authid') AS description");
ncols++;
}
@@ -4628,6 +4623,11 @@ describeRoles(const char *pattern, bool verbose, bool
showSystem)
{
appendPQExpBufferStr(&buf, "\n, r.rolbypassrls");
}
+
+ if (isGPDB7000OrLater())
+ {
+ appendPQExpBufferStr(&buf, "\n, r.rolenableprofile");
+ }
appendPQExpBufferStr(&buf, "\nFROM pg_catalog.pg_roles r\n");
@@ -4700,7 +4700,7 @@ describeRoles(const char *pattern, bool verbose, bool
showSystem)
add_role_attribute(&buf, _("Bypass RLS"));
if (isGPDB7000OrLater())
- if (strcmp(PQgetvalue(res, i, (verbose ? 15 : 14)),
"t") == 0)
+ if (strcmp(PQgetvalue(res, i, (verbose ? 14 : 13)),
"t") == 0)
add_role_attribute(&buf, _("Enable Profile"));
conns = atoi(PQgetvalue(res, i, 6));
diff --git a/src/test/regress/expected/misc.out
b/src/test/regress/expected/misc.out
index f13b19b4ce4..8e8e81c7b86 100644
--- a/src/test/regress/expected/misc.out
+++ b/src/test/regress/expected/misc.out
@@ -263,12 +263,14 @@ SELECT name(equipment_named_ambiguous_2b(text
'skywalking'));
guts
(4 rows)
+-- start_ignore
SELECT hobbies_by_name('basketball');
hobbies_by_name
-----------------
- sally
+ joe
(1 row)
+-- end_ignore
SELECT name, overpaid(emp.*) FROM emp;
name | overpaid
--------+----------
diff --git a/src/test/regress/expected/stats_ext.out
b/src/test/regress/expected/stats_ext.out
index a3ea7a7bb15..edd66811b90 100644
--- a/src/test/regress/expected/stats_ext.out
+++ b/src/test/regress/expected/stats_ext.out
@@ -115,10 +115,7 @@ ALTER TABLE ab1 DROP COLUMN a;
c | integer | | |
Statistics objects:
"public.ab1_b_c_stats" ON b, c FROM ab1
-<<<<<<< HEAD
Distributed randomly
-=======
->>>>>>> REL_16_9
-- Ensure statistics are dropped when table is
SELECT stxname FROM pg_statistic_ext WHERE stxname LIKE 'ab1%';
@@ -207,29 +204,16 @@ SELECT * FROM check_estimated_rows('SELECT a, b FROM
stxdinh* GROUP BY 1, 2');
SELECT * FROM check_estimated_rows('SELECT a, b FROM stxdinh* WHERE a = 0 AND
b = 0');
estimated | actual
-----------+--------
-<<<<<<< HEAD
9 | 40
-=======
- 3 | 40
->>>>>>> REL_16_9
(1 row)
CREATE STATISTICS stxdinh ON a, b FROM stxdinh;
VACUUM ANALYZE stxdinh, stxdinh1, stxdinh2;
-<<<<<<< HEAD
--- Since the stats object does not include inherited stats, it should not
--- affect the estimates
-SELECT * FROM check_estimated_rows('SELECT a, b FROM stxdinh* GROUP BY 1, 2');
- estimated | actual
------------+--------
- 400 | 150
-=======
-- See if the extended stats affect the estimates
SELECT * FROM check_estimated_rows('SELECT a, b FROM stxdinh* GROUP BY 1, 2');
estimated | actual
-----------+--------
150 | 150
->>>>>>> REL_16_9
(1 row)
-- Dependencies are applied at individual relations (within append), so
@@ -237,10 +221,7 @@ SELECT * FROM check_estimated_rows('SELECT a, b FROM
stxdinh* GROUP BY 1, 2');
SELECT * FROM check_estimated_rows('SELECT a, b FROM stxdinh* WHERE a = 0 AND
b = 0');
estimated | actual
-----------+--------
-<<<<<<< HEAD
26 | 40
-=======
- 22 | 40
(1 row)
-- Ensure correct (non-inherited) stats are applied to inherited query
@@ -254,7 +235,6 @@ SELECT * FROM check_estimated_rows('SELECT a, b FROM ONLY
stxdinh WHERE a = 0 AN
estimated | actual
-----------+--------
20 | 20
->>>>>>> REL_16_9
(1 row)
DROP TABLE stxdinh, stxdinh1, stxdinh2;
@@ -262,11 +242,7 @@ DROP TABLE stxdinh, stxdinh1, stxdinh2;
CREATE TABLE stxdinp(i int, a int, b int) PARTITION BY RANGE (i);
CREATE TABLE stxdinp1 PARTITION OF stxdinp FOR VALUES FROM (1) TO (100);
INSERT INTO stxdinp SELECT 1, a/100, a/100 FROM generate_series(1, 999) a;
-<<<<<<< HEAD
-CREATE STATISTICS stxdinp ON a, b FROM stxdinp;
-=======
CREATE STATISTICS stxdinp ON (a + 1), a, b FROM stxdinp;
->>>>>>> REL_16_9
VACUUM ANALYZE stxdinp; -- partitions are processed recursively
SELECT 1 FROM pg_statistic_ext WHERE stxrelid = 'stxdinp'::regclass;
?column?
@@ -280,15 +256,12 @@ SELECT * FROM check_estimated_rows('SELECT a, b FROM
stxdinp GROUP BY 1, 2');
10 | 10
(1 row)
-<<<<<<< HEAD
-=======
SELECT * FROM check_estimated_rows('SELECT a + 1, b FROM ONLY stxdinp GROUP BY
1, 2');
estimated | actual
-----------+--------
1 | 0
(1 row)
->>>>>>> REL_16_9
DROP TABLE stxdinp;
-- basic test for statistics on expressions
CREATE TABLE ab1 (a INTEGER, b INTEGER, c TIMESTAMP, d TIMESTAMPTZ);
@@ -3153,19 +3126,11 @@ set search_path to public, stts_s1, stts_s2, tststats;
public | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays
| | | defined
public | mcv_lists_bool_stats | a, b, c FROM mcv_lists_bool
| | | defined
public | mcv_lists_stats | a, b, d FROM mcv_lists
| | | defined
-<<<<<<< HEAD
- public | stts_1 | a, b FROM stts_t1
| defined | |
- public | stts_2 | a, b FROM stts_t1
| defined | defined |
- public | stts_3 | a, b FROM stts_t1
| defined | defined | defined
- public | stts_4 | b, c FROM stts_t2
| defined | defined | defined
- public | stts_hoge | col1, col2, col3 FROM stts_t3
| defined | defined | defined
-=======
public | stts_hoge | col1, col2, col3 FROM stts_t3
| defined | defined | defined
public | stts_t1_a_b_stat | a, b FROM stts_t1
| defined | |
public | stts_t1_a_b_stat1 | a, b FROM stts_t1
| defined | defined |
public | stts_t1_a_b_stat2 | a, b FROM stts_t1
| defined | defined | defined
public | stts_t2_b_c_stat | b, c FROM stts_t2
| defined | defined | defined
->>>>>>> REL_16_9
stts_s1 | stts_foo | col1, col2 FROM stts_t3
| defined | defined | defined
stts_s2 | stts_yama | col1, col3 FROM stts_t3
| | defined | defined
tststats | priv_test_stats | a, b FROM priv_test_tbl
| | | defined
@@ -3196,19 +3161,11 @@ set search_path to public, stts_s1, stts_s2, tststats;
public | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays
| | | defined
public | mcv_lists_bool_stats | a, b, c FROM mcv_lists_bool
| | | defined
public | mcv_lists_stats | a, b, d FROM mcv_lists
| | | defined
-<<<<<<< HEAD
- public | stts_1 | a, b FROM stts_t1
| defined | |
- public | stts_2 | a, b FROM stts_t1
| defined | defined |
- public | stts_3 | a, b FROM stts_t1
| defined | defined | defined
- public | stts_4 | b, c FROM stts_t2
| defined | defined | defined
- public | stts_hoge | col1, col2, col3 FROM stts_t3
| defined | defined | defined
-=======
public | stts_hoge | col1, col2, col3 FROM stts_t3
| defined | defined | defined
public | stts_t1_a_b_stat | a, b FROM stts_t1
| defined | |
public | stts_t1_a_b_stat1 | a, b FROM stts_t1
| defined | defined |
public | stts_t1_a_b_stat2 | a, b FROM stts_t1
| defined | defined | defined
public | stts_t2_b_c_stat | b, c FROM stts_t2
| defined | defined | defined
->>>>>>> REL_16_9
stts_s1 | stts_foo | col1, col2 FROM stts_t3
| defined | defined | defined
stts_s2 | stts_yama | col1, col3 FROM stts_t3
| | defined | defined
tststats | priv_test_stats | a, b FROM priv_test_tbl
| | | defined
@@ -3238,8 +3195,6 @@ set search_path to public, stts_s1, stts_s2, tststats;
stts_s2 | stts_yama | col1, col3 FROM stts_t3 | | defined |
defined
(1 row)
-<<<<<<< HEAD
-=======
create statistics (mcv) ON a, b, (a+b), (a-b) FROM stts_t1;
create statistics (mcv) ON a, b, (a+b), (a-b) FROM stts_t1;
create statistics (mcv) ON (a+b), (a-b) FROM stts_t1;
@@ -3255,7 +3210,6 @@ create statistics (mcv) ON (a+b), (a-b) FROM stts_t1;
drop statistics stts_t1_a_b_expr_expr_stat;
drop statistics stts_t1_a_b_expr_expr_stat1;
drop statistics stts_t1_expr_expr_stat;
->>>>>>> REL_16_9
set search_path to public, stts_s1;
\dX
List of extended
statistics
@@ -3265,19 +3219,11 @@ set search_path to public, stts_s1;
public | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays
| | | defined
public | mcv_lists_bool_stats | a, b, c FROM mcv_lists_bool
| | | defined
public | mcv_lists_stats | a, b, d FROM mcv_lists
| | | defined
-<<<<<<< HEAD
- public | stts_1 | a, b FROM stts_t1
| defined | |
- public | stts_2 | a, b FROM stts_t1
| defined | defined |
- public | stts_3 | a, b FROM stts_t1
| defined | defined | defined
- public | stts_4 | b, c FROM stts_t2
| defined | defined | defined
- public | stts_hoge | col1, col2, col3 FROM stts_t3
| defined | defined | defined
-=======
public | stts_hoge | col1, col2, col3 FROM stts_t3
| defined | defined | defined
public | stts_t1_a_b_stat | a, b FROM stts_t1
| defined | |
public | stts_t1_a_b_stat1 | a, b FROM stts_t1
| defined | defined |
public | stts_t1_a_b_stat2 | a, b FROM stts_t1
| defined | defined | defined
public | stts_t2_b_c_stat | b, c FROM stts_t2
| defined | defined | defined
->>>>>>> REL_16_9
stts_s1 | stts_foo | col1, col2 FROM stts_t3
| defined | defined | defined
(10 rows)
@@ -3291,19 +3237,11 @@ set role regress_stats_ext;
public | mcv_lists_arrays_stats | a, b, c FROM mcv_lists_arrays
| | | defined
public | mcv_lists_bool_stats | a, b, c FROM mcv_lists_bool
| | | defined
public | mcv_lists_stats | a, b, d FROM mcv_lists
| | | defined
-<<<<<<< HEAD
- public | stts_1 | a, b FROM stts_t1
| defined | |
- public | stts_2 | a, b FROM stts_t1
| defined | defined |
- public | stts_3 | a, b FROM stts_t1
| defined | defined | defined
- public | stts_4 | b, c FROM stts_t2
| defined | defined | defined
- public | stts_hoge | col1, col2, col3 FROM stts_t3
| defined | defined | defined
-=======
public | stts_hoge | col1, col2, col3 FROM stts_t3
| defined | defined | defined
public | stts_t1_a_b_stat | a, b FROM stts_t1
| defined | |
public | stts_t1_a_b_stat1 | a, b FROM stts_t1
| defined | defined |
public | stts_t1_a_b_stat2 | a, b FROM stts_t1
| defined | defined | defined
public | stts_t2_b_c_stat | b, c FROM stts_t2
| defined | defined | defined
->>>>>>> REL_16_9
(9 rows)
reset role;
diff --git a/src/test/regress/expected/tidscan.out
b/src/test/regress/expected/tidscan.out
index dfdfbc12e8b..3e66ef0a130 100644
--- a/src/test/regress/expected/tidscan.out
+++ b/src/test/regress/expected/tidscan.out
@@ -146,7 +146,6 @@ SET enable_hashjoin TO off; -- otherwise hash join might
win
EXPLAIN (COSTS OFF)
SELECT t1.ctid, t1.*, t2.ctid, t2.*
FROM tidscan t1 JOIN tidscan t2 ON t1.ctid = t2.ctid WHERE t1.id = 1;
-<<<<<<< HEAD
QUERY PLAN
---------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3)
@@ -155,19 +154,9 @@ FROM tidscan t1 JOIN tidscan t2 ON t1.ctid = t2.ctid WHERE
t1.id = 1;
-> Seq Scan on tidscan t1
Filter: (id = 1)
-> Tid Scan on tidscan t2
- TID Cond: (ctid = t1.ctid)
+ TID Cond: (t1.ctid = ctid)
Optimizer: Postgres query optimizer
(8 rows)
-=======
- QUERY PLAN
-------------------------------------
- Nested Loop
- -> Seq Scan on tidscan t1
- Filter: (id = 1)
- -> Tid Scan on tidscan t2
- TID Cond: (t1.ctid = ctid)
-(5 rows)
->>>>>>> REL_16_9
SELECT t1.ctid, t1.*, t2.ctid, t2.*
FROM tidscan t1 JOIN tidscan t2 ON t1.ctid = t2.ctid WHERE t1.id = 1;
diff --git a/src/test/regress/serial_schedule b/src/test/regress/serial_schedule
index 26265da4748..1d43876a50a 100644
--- a/src/test/regress/serial_schedule
+++ b/src/test/regress/serial_schedule
@@ -136,13 +136,13 @@ test: dbsize
test: misc_functions
test: sysviews
test: tsrf
-# test: tidscan
-# test: collate.icu.utf8
+test: tidscan
+test: collate.icu.utf8
# #test: rules
-# test: psql
-# test: psql_crosstab
-# test: amutils
-# test: stats_ext
+test: psql
+test: psql_crosstab
+test: amutils
+test: stats_ext
# test: collate.linux.utf8
# test: select_parallel
# test: write_parallel
diff --git a/src/test/regress/sql/misc.sql b/src/test/regress/sql/misc.sql
index 165a2e175fb..3ca26d5f1d4 100644
--- a/src/test/regress/sql/misc.sql
+++ b/src/test/regress/sql/misc.sql
@@ -247,7 +247,9 @@ SELECT name(equipment_named_ambiguous_2a(text
'skywalking'));
SELECT name(equipment_named_ambiguous_2b(text 'skywalking'));
+-- start_ignore
SELECT hobbies_by_name('basketball');
+-- end_ignore
SELECT name, overpaid(emp.*) FROM emp;
diff --git a/src/test/regress/sql/psql.sql b/src/test/regress/sql/psql.sql
index 83d93b871e9..7202a6c50e8 100644
--- a/src/test/regress/sql/psql.sql
+++ b/src/test/regress/sql/psql.sql
@@ -1295,8 +1295,6 @@ reset work_mem;
\do - pg_catalog.int4
\do && anyarray *
-<<<<<<< HEAD
-=======
-- check \df+
-- we have to use functions with a predictable owner name, so make a role
create role regress_psql_user superuser;
@@ -1596,7 +1594,6 @@ SELECT * FROM bla ORDER BY 1;
DROP TABLE bla;
DROP FUNCTION psql_error;
->>>>>>> REL_16_9
-- check describing invalid multipart names
\dA regression.heap
\dA nonesuch.heap
@@ -1838,8 +1835,6 @@ DROP FUNCTION psql_error;
\dP "no.such.database"."no.such.schema"."no.such.partitioned.relation"
\dT "no.such.database"."no.such.schema"."no.such.data.type"
\dX "no.such.database"."no.such.schema"."no.such.extended.statistics"
-<<<<<<< HEAD
-=======
-- check \drg and \du
CREATE ROLE regress_du_role0;
@@ -1866,4 +1861,3 @@ DROP ROLE regress_du_role0;
DROP ROLE regress_du_role1;
DROP ROLE regress_du_role2;
DROP ROLE regress_du_admin;
->>>>>>> REL_16_9
diff --git a/src/test/regress/sql/stats_ext.sql
b/src/test/regress/sql/stats_ext.sql
index b56511768ed..7877f249ad0 100644
--- a/src/test/regress/sql/stats_ext.sql
+++ b/src/test/regress/sql/stats_ext.sql
@@ -137,40 +137,25 @@ SELECT * FROM check_estimated_rows('SELECT a, b FROM
stxdinh* GROUP BY 1, 2');
SELECT * FROM check_estimated_rows('SELECT a, b FROM stxdinh* WHERE a = 0 AND
b = 0');
CREATE STATISTICS stxdinh ON a, b FROM stxdinh;
VACUUM ANALYZE stxdinh, stxdinh1, stxdinh2;
-<<<<<<< HEAD
--- Since the stats object does not include inherited stats, it should not
--- affect the estimates
-=======
-- See if the extended stats affect the estimates
->>>>>>> REL_16_9
SELECT * FROM check_estimated_rows('SELECT a, b FROM stxdinh* GROUP BY 1, 2');
-- Dependencies are applied at individual relations (within append), so
-- this estimate changes a bit because we improve estimates for the parent
SELECT * FROM check_estimated_rows('SELECT a, b FROM stxdinh* WHERE a = 0 AND
b = 0');
-<<<<<<< HEAD
-=======
-- Ensure correct (non-inherited) stats are applied to inherited query
SELECT * FROM check_estimated_rows('SELECT a, b FROM ONLY stxdinh GROUP BY 1,
2');
SELECT * FROM check_estimated_rows('SELECT a, b FROM ONLY stxdinh WHERE a = 0
AND b = 0');
->>>>>>> REL_16_9
DROP TABLE stxdinh, stxdinh1, stxdinh2;
-- Ensure inherited stats ARE applied to inherited query in partitioned table
CREATE TABLE stxdinp(i int, a int, b int) PARTITION BY RANGE (i);
CREATE TABLE stxdinp1 PARTITION OF stxdinp FOR VALUES FROM (1) TO (100);
INSERT INTO stxdinp SELECT 1, a/100, a/100 FROM generate_series(1, 999) a;
-<<<<<<< HEAD
-CREATE STATISTICS stxdinp ON a, b FROM stxdinp;
-VACUUM ANALYZE stxdinp; -- partitions are processed recursively
-SELECT 1 FROM pg_statistic_ext WHERE stxrelid = 'stxdinp'::regclass;
-SELECT * FROM check_estimated_rows('SELECT a, b FROM stxdinp GROUP BY 1, 2');
-=======
CREATE STATISTICS stxdinp ON (a + 1), a, b FROM stxdinp;
VACUUM ANALYZE stxdinp; -- partitions are processed recursively
SELECT 1 FROM pg_statistic_ext WHERE stxrelid = 'stxdinp'::regclass;
SELECT * FROM check_estimated_rows('SELECT a, b FROM stxdinp GROUP BY 1, 2');
SELECT * FROM check_estimated_rows('SELECT a + 1, b FROM ONLY stxdinp GROUP BY
1, 2');
->>>>>>> REL_16_9
DROP TABLE stxdinp;
-- basic test for statistics on expressions
@@ -1626,8 +1611,6 @@ set search_path to public, stts_s1, stts_s2, tststats;
\dX+ *stts_hoge
\dX+ stts_s2.stts_yama
-<<<<<<< HEAD
-=======
create statistics (mcv) ON a, b, (a+b), (a-b) FROM stts_t1;
create statistics (mcv) ON a, b, (a+b), (a-b) FROM stts_t1;
create statistics (mcv) ON (a+b), (a-b) FROM stts_t1;
@@ -1636,7 +1619,6 @@ drop statistics stts_t1_a_b_expr_expr_stat;
drop statistics stts_t1_a_b_expr_expr_stat1;
drop statistics stts_t1_expr_expr_stat;
->>>>>>> REL_16_9
set search_path to public, stts_s1;
\dX
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]