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 c1dd6bf1fa1 Enable psql
c1dd6bf1fa1 is described below

commit c1dd6bf1fa1e437939d7e57fe64b1f07fb3eac28
Author: Jinbao Chen <[email protected]>
AuthorDate: Thu Oct 16 23:18:59 2025 +0800

    Enable psql
---
 GNUmakefile.in                       |  4 ++--
 gpAux/gpdemo/gpdemo-defaults.sh      |  2 --
 src/bin/Makefile                     |  3 ++-
 src/bin/initdb/initdb.c              |  4 ++++
 src/bin/psql/describe.c              | 19 +++++++++----------
 src/bin/psql/help.c                  |  2 +-
 src/bin/psql/nls.mk                  |  4 ----
 src/bin/psql/t/010_tab_completion.pl | 23 -----------------------
 src/bin/psql/tab-complete.c          | 21 +++++++++++----------
 9 files changed, 29 insertions(+), 53 deletions(-)

diff --git a/GNUmakefile.in b/GNUmakefile.in
index f3ac889d1a7..3a8f2d56188 100644
--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -35,7 +35,7 @@ endif
 ifeq ($(enable_pax), yes)
        $(MAKE) -C contrib/pax_storage all
 endif
-#      $(MAKE) -C gpMgmt all
+       $(MAKE) -C gpMgmt all
        $(MAKE) -C gpcontrib all
        +@echo "All of Apache Cloudberry successfully made. Ready to install."
 
@@ -82,7 +82,7 @@ endif
 ifeq ($(with_openssl), yes)
        $(MAKE) -C contrib/sslinfo $@
 endif
-#      $(MAKE) -C gpMgmt $@
+       $(MAKE) -C gpMgmt $@
        $(MAKE) -C gpcontrib $@
        +@echo "Apache Cloudberry installation complete."
 
diff --git a/gpAux/gpdemo/gpdemo-defaults.sh b/gpAux/gpdemo/gpdemo-defaults.sh
index 12ffa40b2d3..84126cbf2a2 100755
--- a/gpAux/gpdemo/gpdemo-defaults.sh
+++ b/gpAux/gpdemo/gpdemo-defaults.sh
@@ -32,7 +32,5 @@ export with_openssl
 
 export DEMO_PORT_BASE="$PORT_BASE"
 export NUM_PRIMARY_MIRROR_PAIRS
-export WITH_MIRRORS
-export WITH_STANDBY
 export BLDWRAP_POSTGRES_CONF_ADDONS
 export DEFAULT_QD_MAX_CONNECT=150
\ No newline at end of file
diff --git a/src/bin/Makefile b/src/bin/Makefile
index d5480add39f..c0a6f8aeb1c 100644
--- a/src/bin/Makefile
+++ b/src/bin/Makefile
@@ -41,7 +41,8 @@ unittest-check:
 
 SUBDIRS = \
        initdb \
-       pg_ctl
+       pg_ctl \
+       psql
 
 ifeq ($(PORTNAME), win32)
 SUBDIRS += pgevent
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 538ee73255d..5278d4c02bc 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -1453,6 +1453,10 @@ setup_config(void)
                                                                          
gvalues->str, false);
        }
 
+       snprintf(repltok, sizeof(repltok), "include = '%s'",
+                        GP_INTERNAL_AUTO_CONF_FILE_NAME);
+       conflines = replace_token(conflines, "#include = 'special.conf'", 
repltok);
+
        /* ... and write out the finished postgresql.conf file */
        snprintf(path, sizeof(path), "%s/postgresql.conf", pg_data);
 
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 0965c5f58a1..7e783c153dd 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -507,41 +507,41 @@ describeFunctions(const char *functypes, const char 
*func_pattern,
                                                  gettext_noop("proc"),
                                                  gettext_noop("func"),
                                                  gettext_noop("Type"));
-       else
+       else if (isGPDB5000OrLater())
                appendPQExpBuffer(&buf,
                                                  "  
pg_catalog.pg_get_function_result(p.oid) as \"%s\",\n"
                                                  "  
pg_catalog.pg_get_function_arguments(p.oid) as \"%s\",\n"
                                                  " CASE\n"
                                                  "  WHEN p.proisagg THEN 
'%s'\n"
-                                                 "  WHEN p.proiswindow THEN 
'%s'\n"
+                                                 "  WHEN p.proiswin THEN 
'%s'\n"
                                                  "  WHEN p.prorettype = 
'pg_catalog.trigger'::pg_catalog.regtype THEN '%s'\n"
                                                  "  ELSE '%s'\n"
-                                                 " END as \"%s\"",
+                                                 "END as \"%s\"",
                                                  gettext_noop("Result data 
type"),
                                                  gettext_noop("Argument data 
types"),
                /* translator: "agg" is short for "aggregate" */
                                                  gettext_noop("agg"),
                                                  gettext_noop("window"),
                                                  gettext_noop("trigger"),
-                                                 gettext_noop("func"),
+                                                 gettext_noop("normal"),
                                                  gettext_noop("Type"));
-       else if (isGPDB5000OrLater())
+       else
                appendPQExpBuffer(&buf,
                                                  "  
pg_catalog.pg_get_function_result(p.oid) as \"%s\",\n"
                                                  "  
pg_catalog.pg_get_function_arguments(p.oid) as \"%s\",\n"
                                                  " CASE\n"
                                                  "  WHEN p.proisagg THEN 
'%s'\n"
-                                                 "  WHEN p.proiswin THEN 
'%s'\n"
+                                                 "  WHEN p.proiswindow THEN 
'%s'\n"
                                                  "  WHEN p.prorettype = 
'pg_catalog.trigger'::pg_catalog.regtype THEN '%s'\n"
                                                  "  ELSE '%s'\n"
-                                                 "END as \"%s\"",
+                                                 " END as \"%s\"",
                                                  gettext_noop("Result data 
type"),
                                                  gettext_noop("Argument data 
types"),
-               /* translator: "agg" is short for "aggregate" */
+                               /* translator: "agg" is short for "aggregate" */
                                                  gettext_noop("agg"),
                                                  gettext_noop("window"),
                                                  gettext_noop("trigger"),
-                                                 gettext_noop("normal"),
+                                                 gettext_noop("func"),
                                                  gettext_noop("Type"));
 
        if (verbose)
@@ -4597,7 +4597,6 @@ describeRoles(const char *pattern, bool verbose, bool 
showSystem)
        int                     conns;
        const char      align = 'l';
        char      **attr;
-       const int   numgreenplumspecificattrs = 3;
 
        myopt.default_footer = false;
 
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index 48c813e2ac0..1f80e102e5c 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -103,7 +103,7 @@ usage(unsigned short int pager)
        HELP0("  -e, --echo-queries       echo commands sent to server\n");
        HELP0("  -E, --echo-hidden        display queries that internal 
commands generate\n");
        HELP0("  -L, --log-file=FILENAME  send session log to file\n");
-       HELP0("      --ignore-log-file    do not log psql:filename prefix in 
log file\");
+       HELP0("      --ignore-log-file    do not log psql:filename prefix in 
log file\n");
        HELP0("  -n, --no-readline        disable enhanced command line editing 
(readline)\n");
        HELP0("  -o, --output=FILENAME    send query results to file (or 
|pipe)\n");
        HELP0("  -q, --quiet              run quietly (no messages, only query 
output)\n");
diff --git a/src/bin/psql/nls.mk b/src/bin/psql/nls.mk
index 5326236b7af..cf0b8002918 100644
--- a/src/bin/psql/nls.mk
+++ b/src/bin/psql/nls.mk
@@ -1,9 +1,5 @@
 # src/bin/psql/nls.mk
 CATALOG_NAME     = psql
-<<<<<<< HEAD
-AVAIL_LANGUAGES  = cs de el es fr it ja ko ru sv tr uk zh_CN
-=======
->>>>>>> REL_16_9
 GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
                    command.c \
                    common.c \
diff --git a/src/bin/psql/t/010_tab_completion.pl 
b/src/bin/psql/t/010_tab_completion.pl
index dc514d050d1..5097a2a241e 100644
--- a/src/bin/psql/t/010_tab_completion.pl
+++ b/src/bin/psql/t/010_tab_completion.pl
@@ -42,32 +42,9 @@ $node->safe_psql('postgres',
                "CREATE TABLE tab1 (c1 int primary key, c2 text);\n"
          . "CREATE TABLE mytab123 (f1 int, f2 text);\n"
          . "CREATE TABLE mytab246 (f1 int, f2 text);\n"
-<<<<<<< HEAD
-         . "CREATE TYPE enum1 AS ENUM ('foo', 'bar', 'baz');\n");
-
-# Developers would not appreciate this test adding a bunch of junk to
-# their ~/.psql_history, so be sure to redirect history into a temp file.
-# We might as well put it in the test log directory, so that buildfarm runs
-# capture the result for possible debugging purposes.
-my $historyfile = "${TestLib::log_path}/010_psql_history.txt";
-$ENV{PSQL_HISTORY} = $historyfile;
-
-# Another pitfall for developers is that they might have a ~/.inputrc
-# file that changes readline's behavior enough to affect this test.
-# So ignore any such file.
-$ENV{INPUTRC} = '/dev/null';
-
-# Unset $TERM so that readline/libedit won't use any terminal-dependent
-# escape sequences; that leads to way too many cross-version variations
-# in the output.
-delete $ENV{TERM};
-# Some versions of readline inspect LS_COLORS, so for luck unset that too.
-delete $ENV{LS_COLORS};
-=======
          . "CREATE TABLE \"mixedName\" (f1 int, f2 text);\n"
          . "CREATE TYPE enum1 AS ENUM ('foo', 'bar', 'baz', 'BLACK');\n"
          . "CREATE PUBLICATION some_publication;\n");
->>>>>>> REL_16_9
 
 # In a VPATH build, we'll be started in the source directory, but we want
 # to run in the build directory so that we can use relative paths to
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 47dfcf3a6e3..3096e0a396f 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -39,8 +39,6 @@
 #include "input.h"
 #include "tab-complete.h"
 
-#define USE_READLINE
-
 /* If we don't have this, we might as well forget about the whole thing: */
 #ifdef USE_READLINE
 
@@ -919,8 +917,8 @@ static const SchemaQuery Query_for_list_of_clusterables = {
        .catname = "pg_catalog.pg_class c",
        .selcondition =
        "c.relkind IN (" CppAsString2(RELKIND_RELATION) ", "
-       CppAsString2(RELKIND_MATVIEW) ", " 
CppAsString2(RELKIND_DIRECTORY_TABLE) ")",
        CppAsString2(RELKIND_PARTITIONED_TABLE) ", "
+       CppAsString2(RELKIND_MATVIEW) ", " 
CppAsString2(RELKIND_DIRECTORY_TABLE) ")",
        .viscondition = "pg_catalog.pg_table_is_visible(c.oid)",
        .namespace = "c.relnamespace",
        .result = "c.relname",
@@ -1015,6 +1013,10 @@ static const SchemaQuery Query_for_trigger_of_table = {
 "SELECT pg_catalog.quote_ident(tagname) FROM pg_catalog.pg_tag " \
 " WHERE substring(pg_catalog.quote_ident(tagname),1,%d)='%s'"
 
+#define Query_for_list_of_tasks \
+"SELECT pg_catalog.quote_ident(jobname) FROM pg_catalog.pg_task "\
+" WHERE username = current_user"
+
 #define Query_for_list_of_encodings \
 " SELECT DISTINCT pg_catalog.pg_encoding_to_char(conforencoding) "\
 "   FROM pg_catalog.pg_conversion "\
@@ -1268,7 +1270,7 @@ static const pgsql_thing_t words_after_create[] = {
        {"DICTIONARY", NULL, NULL, &Query_for_list_of_ts_dictionaries, NULL, 
THING_NO_SHOW},
        {"DIRECTORY TABLE", NULL, NULL, &Query_for_list_of_directory_tables},
        {"DOMAIN", NULL, NULL, &Query_for_list_of_domains},
-       {"DYNAMIC TABLE", NULL, NULL, &Query_for_list_of_matviews, 
THING_NO_ALTER},
+       {"DYNAMIC TABLE", NULL, NULL, &Query_for_list_of_matviews, NULL, 
THING_NO_ALTER},
        {"EVENT TRIGGER", NULL, NULL, NULL},
        {"EXTENSION", Query_for_list_of_extensions},
        {"EXTERNAL TABLE", NULL, NULL, NULL},
@@ -1276,7 +1278,7 @@ static const pgsql_thing_t words_after_create[] = {
        {"FOREIGN TABLE", NULL, NULL, NULL},
        {"FUNCTION", NULL, NULL, Query_for_list_of_functions},
        {"GROUP", Query_for_list_of_roles},
-       {"INCREMENTAL MATERIALIZED VIEW", NULL, NULL, 
&Query_for_list_of_matviews, THING_NO_DROP | THING_NO_ALTER},
+       {"INCREMENTAL MATERIALIZED VIEW", NULL, NULL, 
&Query_for_list_of_matviews, NULL, THING_NO_DROP | THING_NO_ALTER},
        {"INDEX", NULL, NULL, &Query_for_list_of_indexes},
        {"LANGUAGE", Query_for_list_of_languages},
        {"LARGE OBJECT", NULL, NULL, NULL, NULL, THING_NO_CREATE | 
THING_NO_DROP},
@@ -3840,7 +3842,7 @@ psql_completion(const char *text, int start, int end)
        else if (Matches("DROP", "DYNAMIC"))
                COMPLETE_WITH("TABLE");
        else if (Matches("DROP", "DYNAMIC", "TABLE"))
-               COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_matviews, NULL);
+               COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_matviews);
 
        /* DROP STORAGE */
        else if (Matches("DROP", "STORAGE"))
@@ -3849,7 +3851,7 @@ psql_completion(const char *text, int start, int end)
        else if (Matches("DROP", "DIRECTORY"))
                COMPLETE_WITH("TABLE");
        else if (Matches("DROP", "DIRECTORY", "TABLE"))
-               COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_directory_tables, 
NULL);
+               COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_directory_tables);
 
        /* DROP OWNED BY */
        else if (Matches("DROP", "OWNED"))
@@ -4522,10 +4524,9 @@ psql_completion(const char *text, int start, int end)
        else if (Matches("REFRESH", "DYNAMIC"))
                COMPLETE_WITH("TABLE");
        else if (Matches("REFRESH", "DYNAMIC", "TABLE"))
-               COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_matviews,
-                                                                  " UNION 
SELECT 'CONCURRENTLY'");
+               COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_matviews);
        else if (Matches("REFRESH", "DYNAMIC", "TABLE", "CONCURRENTLY"))
-               COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_matviews, NULL);
+               COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_matviews);
        else if (Matches("REFRESH", "DYNAMIC", "TABLE", MatchAny))
                COMPLETE_WITH("WITH");
        else if (Matches("REFRESH", "DYNAMIC", "TABLE", "CONCURRENTLY", 
MatchAny))


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to