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 1b729b01869 Fix conflict for bin/psql
1b729b01869 is described below
commit 1b729b01869e2bf6a6bc5b148edb1ddaaa322bcb
Author: Jinbao Chen <[email protected]>
AuthorDate: Mon Sep 15 10:27:18 2025 +0800
Fix conflict for bin/psql
---
src/bin/psql/command.c | 33 ---
src/bin/psql/describe.c | 594 --------------------------------------------
src/bin/psql/help.c | 100 +-------
src/bin/psql/tab-complete.c | 282 +--------------------
4 files changed, 14 insertions(+), 995 deletions(-)
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index b4965e18285..6dfd388a892 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -2103,38 +2103,15 @@ exec_command_password(PsqlScanState scan_state, bool
active_branch)
{
char *user = psql_scan_slash_option(scan_state,
OT_SQLID, NULL, true);
-<<<<<<< HEAD
- char *pw1;
- char *pw2;
- PQExpBufferData buf;
-=======
char *pw1 = NULL;
char *pw2 = NULL;
PQExpBufferData buf;
PromptInterruptContext prompt_ctx;
->>>>>>> REL_16_9
if (user == NULL)
{
/* By default, the command applies to CURRENT_USER */
PGresult *res;
-<<<<<<< HEAD
-
- res = PSQLexec("SELECT CURRENT_USER");
- if (!res)
- return PSQL_CMD_ERROR;
-
- user = pg_strdup(PQgetvalue(res, 0, 0));
- PQclear(res);
- }
-
- initPQExpBuffer(&buf);
- printfPQExpBuffer(&buf, _("Enter new password for user \"%s\":
"), user);
-
- pw1 = simple_prompt(buf.data, false);
- pw2 = simple_prompt("Enter it again: ", false);
-=======
->>>>>>> REL_16_9
res = PSQLexec("SELECT CURRENT_USER");
if (!res)
@@ -5388,15 +5365,6 @@ do_watch(PQExpBuffer query_buf, double sleep, int iter)
#endif
}
-<<<<<<< HEAD
- /*
- * If the terminal driver echoed "^C", libedit/libreadline might be
- * confused about the cursor position. Therefore, inject a newline
- * before the next prompt is displayed.
- */
- fprintf(stdout, "\n");
- fflush(stdout);
-=======
if (pagerpipe)
{
pclose(pagerpipe);
@@ -5422,7 +5390,6 @@ do_watch(PQExpBuffer query_buf, double sleep, int iter)
/* Unblock SIGINT, SIGCHLD and SIGALRM. */
sigprocmask(SIG_UNBLOCK, &sigalrm_sigchld_sigint, NULL);
#endif
->>>>>>> REL_16_9
pg_free(title);
return (res >= 0);
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 9b72c75adea..0965c5f58a1 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -260,12 +260,6 @@ describeAggregates(const char *pattern, bool verbose, bool
showSystem)
" AND n.nspname
<> 'information_schema'\n");
if (!validateSQLNamePattern(&buf, pattern, true, false,
-<<<<<<< HEAD
- "n.nspname",
"p.proname", NULL,
-
"pg_catalog.pg_function_is_visible(p.oid)",
- NULL, 3))
- return false;
-=======
"n.nspname",
"p.proname", NULL,
"pg_catalog.pg_function_is_visible(p.oid)",
NULL, 3))
@@ -273,7 +267,6 @@ describeAggregates(const char *pattern, bool verbose, bool
showSystem)
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1, 2, 4;");
@@ -343,14 +336,10 @@ describeAccessMethods(const char *pattern, bool verbose)
NULL, "amname",
NULL,
NULL,
NULL, 1))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1;");
@@ -384,24 +373,6 @@ describeTablespaces(const char *pattern, bool verbose)
initPQExpBuffer(&buf);
-<<<<<<< HEAD
- if (pset.sversion >= 90200 || isGPDB6000OrLater())
- printfPQExpBuffer(&buf,
- "SELECT spcname AS \"%s\",\n"
- "
pg_catalog.pg_get_userbyid(spcowner) AS \"%s\",\n"
- "
pg_catalog.pg_tablespace_location(oid) AS \"%s\"",
- gettext_noop("Name"),
- gettext_noop("Owner"),
- gettext_noop("Location"));
- else
- printfPQExpBuffer(&buf,
- "SELECT spcname AS \"%s\",\n"
- "
pg_catalog.pg_get_userbyid(spcowner) AS \"%s\",\n"
- " spclocation AS \"%s\"",
- gettext_noop("Name"),
- gettext_noop("Owner"),
- gettext_noop("Location"));
-=======
printfPQExpBuffer(&buf,
"SELECT spcname AS \"%s\",\n"
"
pg_catalog.pg_get_userbyid(spcowner) AS \"%s\",\n"
@@ -409,7 +380,6 @@ describeTablespaces(const char *pattern, bool verbose)
gettext_noop("Name"),
gettext_noop("Owner"),
gettext_noop("Location"));
->>>>>>> REL_16_9
if (verbose)
{
@@ -431,14 +401,10 @@ describeTablespaces(const char *pattern, bool verbose)
NULL,
"spcname", NULL,
NULL,
NULL, 1))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1;");
@@ -559,7 +525,6 @@ describeFunctions(const char *functypes, const char
*func_pattern,
gettext_noop("trigger"),
gettext_noop("func"),
gettext_noop("Type"));
-<<<<<<< HEAD
else if (isGPDB5000OrLater())
appendPQExpBuffer(&buf,
"
pg_catalog.pg_get_function_result(p.oid) as \"%s\",\n"
@@ -578,70 +543,6 @@ describeFunctions(const char *functypes, const char
*func_pattern,
gettext_noop("trigger"),
gettext_noop("normal"),
gettext_noop("Type"));
- else if (pset.sversion >= 80100)
- appendPQExpBuffer(&buf,
- " CASE WHEN p.proretset THEN
'SETOF ' ELSE '' END ||\n"
- "
pg_catalog.format_type(p.prorettype, NULL) as \"%s\",\n"
- " CASE WHEN proallargtypes
IS NOT NULL THEN\n"
- "
pg_catalog.array_to_string(ARRAY(\n"
- " SELECT\n"
- " CASE\n"
- " WHEN
p.proargmodes[s.i] = 'i' THEN ''\n"
- " WHEN
p.proargmodes[s.i] = 'o' THEN 'OUT '\n"
- " WHEN
p.proargmodes[s.i] = 'b' THEN 'INOUT '\n"
- " WHEN
p.proargmodes[s.i] = 'v' THEN 'VARIADIC '\n"
- " END ||\n"
- " CASE\n"
- " WHEN
COALESCE(p.proargnames[s.i], '') = '' THEN ''\n"
- " ELSE
p.proargnames[s.i] || ' '\n"
- " END ||\n"
- "
pg_catalog.format_type(p.proallargtypes[s.i], NULL)\n"
- " FROM\n"
- "
pg_catalog.generate_series(1, pg_catalog.array_upper(p.proallargtypes, 1)) AS
s(i)\n"
- " ), ', ')\n"
- " ELSE\n"
- "
pg_catalog.array_to_string(ARRAY(\n"
- " SELECT\n"
- " CASE\n"
- " WHEN
COALESCE(p.proargnames[s.i+1], '') = '' THEN ''\n"
- " ELSE
p.proargnames[s.i+1] || ' '\n"
- " END ||\n"
- "
pg_catalog.format_type(p.proargtypes[s.i], NULL)\n"
- " FROM\n"
- "
pg_catalog.generate_series(0, pg_catalog.array_upper(p.proargtypes, 1)) AS
s(i)\n"
- " ), ', ')\n"
- " END AS \"%s\",\n"
- " CASE\n"
- " WHEN p.proisagg THEN
'%s'\n"
- " WHEN p.prorettype =
'pg_catalog.trigger'::pg_catalog.regtype THEN '%s'\n"
- " ELSE '%s'\n"
- " END AS \"%s\"",
- gettext_noop("Result data
type"),
- gettext_noop("Argument data
types"),
- /* translator: "agg" is short for "aggregate" */
- gettext_noop("agg"),
- gettext_noop("trigger"),
- gettext_noop("func"),
- gettext_noop("Type"));
- else
- appendPQExpBuffer(&buf,
- " CASE WHEN p.proretset THEN
'SETOF ' ELSE '' END ||\n"
- "
pg_catalog.format_type(p.prorettype, NULL) as \"%s\",\n"
- "
pg_catalog.oidvectortypes(p.proargtypes) as \"%s\",\n"
- " CASE\n"
- " WHEN p.proisagg THEN
'%s'\n"
- " WHEN p.prorettype =
'pg_catalog.trigger'::pg_catalog.regtype THEN '%s'\n"
- " ELSE '%s'\n"
- " END AS \"%s\"",
- gettext_noop("Result data
type"),
- gettext_noop("Argument data
types"),
- /* translator: "agg" is short for "aggregate" */
- gettext_noop("agg"),
- gettext_noop("trigger"),
- gettext_noop("func"),
- gettext_noop("Type"));
-=======
->>>>>>> REL_16_9
if (verbose)
{
@@ -832,11 +733,7 @@ describeFunctions(const char *functypes, const char
*func_pattern,
"n.nspname",
"p.proname", NULL,
"pg_catalog.pg_function_is_visible(p.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
goto error_return;
->>>>>>> REL_16_9
for (int i = 0; i < num_arg_patterns; i++)
{
@@ -863,11 +760,7 @@ describeFunctions(const char *functypes, const char
*func_pattern,
true, false,
nspname, typname, ft, tiv,
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
goto error_return;
->>>>>>> REL_16_9
}
else
{
@@ -941,39 +834,6 @@ describeTypes(const char *pattern, bool verbose, bool
showSystem)
" WHEN t.typlen < 0\n"
" THEN CAST('var' AS
pg_catalog.text)\n"
" ELSE CAST(t.typlen AS
pg_catalog.text)\n"
-<<<<<<< HEAD
- " END AS \"%s\",\n",
- gettext_noop("Internal name"),
- gettext_noop("Size"));
- }
- if (verbose && pset.sversion >= 80300)
- {
- appendPQExpBufferStr(&buf,
- "
pg_catalog.array_to_string(\n"
- " ARRAY(\n"
- " SELECT
e.enumlabel\n"
- " FROM
pg_catalog.pg_enum e\n"
- " WHERE
e.enumtypid = t.oid\n");
-
- if (pset.sversion >= 90100)
- appendPQExpBufferStr(&buf,
- "
ORDER BY e.enumsortorder\n");
- else
- appendPQExpBufferStr(&buf,
- "
ORDER BY e.oid\n");
-
- appendPQExpBuffer(&buf,
- " ),\n"
- " E'\\n'\n"
- " ) AS \"%s\",\n",
- gettext_noop("Elements"));
- if (verbose && isGE42 == true)
- appendPQExpBuffer(&buf, "
pg_catalog.array_to_string(te.typoptions, ',') AS \"%s\",\n",
gettext_noop("Type Options"));
- }
- if (verbose)
- {
- appendPQExpBuffer(&buf,
-=======
" END AS \"%s\",\n"
"
pg_catalog.array_to_string(\n"
" ARRAY(\n"
@@ -984,7 +844,6 @@ describeTypes(const char *pattern, bool verbose, bool
showSystem)
" ),\n"
" E'\\n'\n"
" ) AS \"%s\",\n"
->>>>>>> REL_16_9
"
pg_catalog.pg_get_userbyid(t.typowner) AS \"%s\",\n",
gettext_noop("Internal name"),
gettext_noop("Size"),
@@ -1029,14 +888,10 @@ describeTypes(const char *pattern, bool verbose, bool
showSystem)
"pg_catalog.format_type(t.oid, NULL)",
"pg_catalog.pg_type_is_visible(t.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
@@ -1190,11 +1045,7 @@ describeOperators(const char *oper_pattern,
"n.nspname",
"o.oprname", NULL,
"pg_catalog.pg_operator_is_visible(o.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
goto error_return;
->>>>>>> REL_16_9
if (num_arg_patterns == 1)
appendPQExpBufferStr(&buf, " AND o.oprleft = 0\n");
@@ -1224,11 +1075,7 @@ describeOperators(const char *oper_pattern,
true, false,
nspname, typname, ft, tiv,
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
goto error_return;
->>>>>>> REL_16_9
}
else
{
@@ -1330,12 +1177,6 @@ listAllDbs(const char *pattern, bool verbose)
" JOIN
pg_catalog.pg_tablespace t on d.dattablespace = t.oid\n");
if (pattern)
-<<<<<<< HEAD
- if (!validateSQLNamePattern(&buf, pattern, false, false,
- NULL,
"d.datname", NULL, NULL,
- NULL,
1))
- return false;
-=======
{
if (!validateSQLNamePattern(&buf, pattern, false, false,
NULL,
"d.datname", NULL, NULL,
@@ -1345,7 +1186,6 @@ listAllDbs(const char *pattern, bool verbose)
return false;
}
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1;");
res = PSQLexec(buf.data);
@@ -1492,19 +1332,6 @@ permissionsList(const char *pattern, bool showSystem)
CppAsString2(RELKIND_FOREIGN_TABLE) ","
CppAsString2(RELKIND_PARTITIONED_TABLE) ")\n");
-<<<<<<< HEAD
- /*
- * Unless a schema pattern is specified, we suppress system and temp
- * tables, since they normally aren't very interesting from a
permissions
- * point of view. You can see 'em by explicit request though, eg with
\z
- * pg_catalog.*
- */
- if (!validateSQLNamePattern(&buf, pattern, true, false,
- "n.nspname",
"c.relname", NULL,
- "n.nspname !~
'^pg_' AND pg_catalog.pg_table_is_visible(c.oid)",
- NULL, 3))
- return false;
-=======
if (!showSystem && !pattern)
appendPQExpBufferStr(&buf, " AND n.nspname <>
'pg_catalog'\n"
" AND n.nspname
<> 'information_schema'\n");
@@ -1514,7 +1341,6 @@ permissionsList(const char *pattern, bool showSystem)
"pg_catalog.pg_table_is_visible(c.oid)",
NULL, 3))
goto error_return;
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
@@ -1588,11 +1414,7 @@ listDefaultACLs(const char *pattern)
"pg_catalog.pg_get_userbyid(d.defaclrole)",
NULL,
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
goto error_return;
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1, 2, 3;");
@@ -1669,11 +1491,7 @@ objectDescription(const char *pattern, bool showSystem)
false,
"n.nspname", "pgc.conname", NULL,
"pg_catalog.pg_table_is_visible(c.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
goto error_return;
->>>>>>> REL_16_9
/* Domain constraint descriptions */
appendPQExpBuffer(&buf,
@@ -1697,11 +1515,7 @@ objectDescription(const char *pattern, bool showSystem)
false,
"n.nspname", "pgc.conname", NULL,
"pg_catalog.pg_type_is_visible(t.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
goto error_return;
->>>>>>> REL_16_9
/* Operator class descriptions */
appendPQExpBuffer(&buf,
@@ -1727,14 +1541,6 @@ objectDescription(const char *pattern, bool showSystem)
NULL, 3))
goto error_return;
-<<<<<<< HEAD
- if (!validateSQLNamePattern(&buf, pattern, true, false,
-
"n.nspname", "o.opcname", NULL,
-
"pg_catalog.pg_opclass_is_visible(o.oid)",
- NULL,
3))
- return false;
- }
-=======
/* Operator family descriptions */
appendPQExpBuffer(&buf,
"UNION ALL\n"
@@ -1748,30 +1554,16 @@ objectDescription(const char *pattern, bool showSystem)
" JOIN pg_catalog.pg_namespace n "
"ON opf.opfnamespace = n.oid\n",
gettext_noop("operator family"));
->>>>>>> REL_16_9
if (!showSystem && !pattern)
appendPQExpBufferStr(&buf, " AND n.nspname <>
'pg_catalog'\n"
" AND n.nspname
<> 'information_schema'\n");
-<<<<<<< HEAD
- if (!showSystem && !pattern)
- appendPQExpBufferStr(&buf, " AND n.nspname <>
'pg_catalog'\n"
- " AND
n.nspname <> 'information_schema'\n");
-
- if (!validateSQLNamePattern(&buf, pattern, true, false,
-
"n.nspname", "opf.opfname", NULL,
-
"pg_catalog.pg_opfamily_is_visible(opf.oid)",
- NULL,
3))
- return false;
- }
-=======
if (!validateSQLNamePattern(&buf, pattern, true, false,
"n.nspname",
"opf.opfname", NULL,
"pg_catalog.pg_opfamily_is_visible(opf.oid)",
NULL, 3))
goto error_return;
->>>>>>> REL_16_9
/* Rule descriptions (ignore rules for views) */
appendPQExpBuffer(&buf,
@@ -1794,11 +1586,7 @@ objectDescription(const char *pattern, bool showSystem)
"n.nspname",
"r.rulename", NULL,
"pg_catalog.pg_table_is_visible(c.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
goto error_return;
->>>>>>> REL_16_9
/* Trigger descriptions */
appendPQExpBuffer(&buf,
@@ -1820,11 +1608,7 @@ objectDescription(const char *pattern, bool showSystem)
"n.nspname",
"t.tgname", NULL,
"pg_catalog.pg_table_is_visible(c.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
goto error_return;
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf,
") AS tt\n"
@@ -1886,14 +1670,10 @@ describeTableDetails(const char *pattern, bool verbose,
bool showSystem)
"n.nspname",
"c.relname", NULL,
"pg_catalog.pg_table_is_visible(c.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 2, 3;");
@@ -2148,79 +1928,6 @@ describeOneTableDetails(const char *schemaname,
(isGPDB() ? "c.relstorage" :
"'h'"),
oid);
}
-<<<<<<< HEAD
- else if (pset.sversion >= 90000)
- {
- printfPQExpBuffer(&buf,
- "SELECT c.relchecks,
c.relkind, c.relhasindex, c.relhasrules, "
- "c.relhastriggers, false,
false, c.relhasoids, "
- "false as relispartition, %s,
c.reltablespace, "
- "CASE WHEN c.reloftype = 0
THEN '' ELSE c.reloftype::pg_catalog.regtype::pg_catalog.text END\n"
- ", %s as relstorage "
- "FROM pg_catalog.pg_class c\n
"
- "LEFT JOIN
pg_catalog.pg_class tc ON (c.reltoastrelid = tc.oid)\n"
- "WHERE c.oid = '%s';",
- (verbose ?
-
"pg_catalog.array_to_string(c.reloptions || "
- "array(select 'toast.' || x
from pg_catalog.unnest(tc.reloptions) x), ', ')\n"
- : "''"),
- /* GPDB Only: relstorage */
- (isGPDB() ? "c.relstorage" :
"'h'"),
- oid);
- }
- else if (pset.sversion >= 80400)
- {
- printfPQExpBuffer(&buf,
- "SELECT c.relchecks,
c.relkind, c.relhasindex, c.relhasrules, "
- "c.relhastriggers, false,
false, c.relhasoids, "
- "false as relispartition, %s,
c.reltablespace\n"
- ", %s as relstorage "
- "FROM pg_catalog.pg_class c\n
"
- "LEFT JOIN
pg_catalog.pg_class tc ON (c.reltoastrelid = tc.oid)\n"
- "WHERE c.oid = '%s';",
- (verbose ?
-
"pg_catalog.array_to_string(c.reloptions || "
- "array(select 'toast.' || x
from pg_catalog.unnest(tc.reloptions) x), ', ')\n"
- : "''"),
- /* GPDB Only: relstorage */
- (isGPDB() ? "c.relstorage" :
"'h'"),
- oid);
- }
- else if (pset.sversion >= 80200)
- {
- printfPQExpBuffer(&buf,
- "SELECT relchecks, relkind,
relhasindex, relhasrules, "
- "reltriggers <> 0, false,
false, relhasoids, "
- "false as relispartition, %s,
reltablespace\n"
- ", %s as relstorage "
- "FROM pg_catalog.pg_class
WHERE oid = '%s';",
- (verbose ?
-
"pg_catalog.array_to_string(reloptions, E', ')" : "''"),
- /* GPDB Only: relstorage */
- (isGPDB() ? "relstorage" :
"'h'"),
- oid);
- }
- else if (pset.sversion >= 80000)
- {
- printfPQExpBuffer(&buf,
- "SELECT relchecks, relkind,
relhasindex, relhasrules, "
- "reltriggers <> 0, false,
false, relhasoids, "
- "false as relispartition, '',
reltablespace\n"
- "FROM pg_catalog.pg_class
WHERE oid = '%s';",
- oid);
- }
- else
- {
- printfPQExpBuffer(&buf,
- "SELECT relchecks, relkind,
relhasindex, relhasrules, "
- "reltriggers <> 0, false,
false, relhasoids, "
- "false as relispartition, '',
''\n"
- "FROM pg_catalog.pg_class
WHERE oid = '%s';",
- oid);
- }
-=======
->>>>>>> REL_16_9
-
res = PSQLexec(buf.data);
if (!res)
goto error_return;
@@ -3842,18 +3549,8 @@ describeOneTableDetails(const char *schemaname,
printfPQExpBuffer(&buf,
"SELECT t.tgname, "
-<<<<<<< HEAD
-
"pg_catalog.pg_get_triggerdef(t.oid%s), "
- "t.tgenabled, %s,\n",
- (pset.sversion >= 90000 ? ",
true" : ""),
- (pset.sversion >= 90000 ?
"t.tgisinternal" :
- pset.sversion >= 80300 ?
- "t.tgconstraint <> 0 AS
tgisinternal" :
- "false AS tgisinternal"));
-=======
"pg_catalog.pg_get_triggerdef(t.oid, true), "
"t.tgenabled,
t.tgisinternal,\n");
->>>>>>> REL_16_9
/*
* Detect whether each trigger is inherited, and if so, get the
name
@@ -3887,9 +3584,6 @@ describeOneTableDetails(const char *schemaname,
"WHERE t.tgrelid = '%s' AND ",
oid);
-<<<<<<< HEAD
- if (pset.sversion >= 110000)
-=======
/*
* tgisinternal is set true for inherited triggers of
partitions in
* servers between v11 and v14, though these must still be
shown to
@@ -3898,7 +3592,6 @@ describeOneTableDetails(const char *schemaname,
* dependence on another trigger.
*/
if (pset.sversion >= 110000 && pset.sversion < 150000)
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "(NOT t.tgisinternal OR
(t.tgisinternal AND t.tgenabled = 'D') \n"
" OR EXISTS
(SELECT 1 FROM pg_catalog.pg_depend WHERE objid = t.oid \n"
" AND
refclassid = 'pg_catalog.pg_trigger'::pg_catalog.regclass))");
@@ -4297,7 +3990,6 @@ error_return:
free(view_def);
-<<<<<<< HEAD
if (tableinfo.compressionType)
free(tableinfo.compressionType);
if (tableinfo.compressionLevel)
@@ -4307,11 +3999,7 @@ error_return:
if (tableinfo.checksum)
free(tableinfo.checksum);
- if (res)
- PQclear(res);
-=======
PQclear(res);
->>>>>>> REL_16_9
return retval;
}
@@ -4922,63 +4610,21 @@ describeRoles(const char *pattern, bool verbose, bool
showSystem)
if (verbose)
{
-<<<<<<< HEAD
- printfPQExpBuffer(&buf,
- "SELECT r.rolname,
r.rolsuper, r.rolinherit,\n"
- " r.rolcreaterole,
r.rolcreatedb, r.rolcanlogin,\n"
- " r.rolconnlimit,
r.rolvaliduntil,\n"
- " ARRAY(SELECT b.rolname\n"
- " FROM
pg_catalog.pg_auth_members m\n"
- " JOIN
pg_catalog.pg_roles b ON (m.roleid = b.oid)\n"
- " WHERE m.member =
r.oid) as memberof");
-
/* add Cloudberry specific attributes */
appendPQExpBufferStr(&buf, "\n, r.rolcreaterextgpfd");
appendPQExpBufferStr(&buf, "\n, r.rolcreatewextgpfd");
appendPQExpBufferStr(&buf, "\n, r.rolcreaterexthttp");
- if (verbose && pset.sversion >= 80200)
- {
- appendPQExpBufferStr(&buf, "\n,
pg_catalog.shobj_description(r.oid, 'pg_authid') AS description");
- ncols++;
- }
- if (pset.sversion >= 90100)
- {
- appendPQExpBufferStr(&buf, "\n, r.rolreplication");
- }
-
- if (pset.sversion >= 90500)
- {
- appendPQExpBufferStr(&buf, "\n, r.rolbypassrls");
- }
-
if (isGPDB7000OrLater())
{
appendPQExpBufferStr(&buf, "\n, r.rolenableprofile");
}
- appendPQExpBufferStr(&buf, "\nFROM pg_catalog.pg_roles r\n");
-
- if (!showSystem && !pattern)
- appendPQExpBufferStr(&buf, "WHERE r.rolname !~
'^pg_'\n");
-
- if (!validateSQLNamePattern(&buf, pattern, false, false,
- NULL,
"r.rolname", NULL, NULL,
- NULL,
1))
- return false;
-=======
appendPQExpBufferStr(&buf, "\n,
pg_catalog.shobj_description(r.oid, 'pg_authid') AS description");
ncols++;
->>>>>>> REL_16_9
}
appendPQExpBufferStr(&buf, "\n, r.rolreplication");
-<<<<<<< HEAD
- if (!validateSQLNamePattern(&buf, pattern, false, false,
- NULL,
"u.usename", NULL, NULL,
- NULL,
1))
- return false;
-=======
if (pset.sversion >= 90500)
{
appendPQExpBufferStr(&buf, "\n, r.rolbypassrls");
@@ -4995,7 +4641,6 @@ describeRoles(const char *pattern, bool verbose, bool
showSystem)
{
termPQExpBuffer(&buf);
return false;
->>>>>>> REL_16_9
}
appendPQExpBufferStr(&buf, "ORDER BY 1;");
@@ -5048,15 +4693,8 @@ describeRoles(const char *pattern, bool verbose, bool
showSystem)
if (strcmp(PQgetvalue(res, i, 5), "t") != 0)
add_role_attribute(&buf, _("Cannot login"));
-<<<<<<< HEAD
- if (pset.sversion >= 90100)
- /* +numgreenplumspecificattrs is due to additional
Cloudberry specific attributes */
- if (strcmp(PQgetvalue(res, i, (verbose ? 10 +
numgreenplumspecificattrs : 9 + numgreenplumspecificattrs)), "t") == 0)
- add_role_attribute(&buf, _("Replication"));
-=======
if (strcmp(PQgetvalue(res, i, (verbose ? 9 : 8)), "t") == 0)
add_role_attribute(&buf, _("Replication"));
->>>>>>> REL_16_9
if (pset.sversion >= 90500)
if (strcmp(PQgetvalue(res, i, (verbose ? 10 : 9)), "t")
== 0)
@@ -5093,15 +4731,8 @@ describeRoles(const char *pattern, bool verbose, bool
showSystem)
printTableAddCell(&cont, attr[i], false, false);
-<<<<<<< HEAD
- printTableAddCell(&cont, PQgetvalue(res, i, 8), false, false);
-
- if (verbose && pset.sversion >= 80200)
- printTableAddCell(&cont, PQgetvalue(res, i, 9 +
numgreenplumspecificattrs), false, false);
-=======
if (verbose)
printTableAddCell(&cont, PQgetvalue(res, i, 8), false,
false);
->>>>>>> REL_16_9
}
termPQExpBuffer(&buf);
@@ -5148,19 +4779,11 @@ listDbRoleSettings(const char *pattern, const char
*pattern2)
gettext_noop("Settings"));
if (!validateSQLNamePattern(&buf, pattern, false, false,
NULL,
"r.rolname", NULL, NULL, &havewhere, 1))
-<<<<<<< HEAD
- return false;
- if (!validateSQLNamePattern(&buf, pattern2, havewhere, false,
- NULL,
"d.datname", NULL, NULL,
- NULL, 1))
- return false;
-=======
goto error_return;
if (!validateSQLNamePattern(&buf, pattern2, havewhere, false,
NULL,
"d.datname", NULL, NULL,
NULL, 1))
goto error_return;
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
res = PSQLexec(buf.data);
@@ -5488,7 +5111,6 @@ listTables(const char *tabtypes, const char *pattern,
bool verbose, bool showSys
" AND n.nspname
!~ '^pg_toast'\n"
" AND n.nspname
<> 'information_schema'\n");
-<<<<<<< HEAD
/*
* TOAST objects are suppressed unconditionally. Since we don't provide
* any way to select RELKIND_TOASTVALUE above, we would never show toast
@@ -5501,22 +5123,14 @@ listTables(const char *tabtypes, const char *pattern,
bool verbose, bool showSys
if (!showChildren)
appendPQExpBuffer(&buf, " AND c.oid NOT IN (select
inhrelid from pg_catalog.pg_inherits)\n");
-
-=======
->>>>>>> REL_16_9
if (!validateSQLNamePattern(&buf, pattern, true, false,
"n.nspname",
"c.relname", NULL,
"pg_catalog.pg_table_is_visible(c.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1,2;");
@@ -5733,14 +5347,10 @@ listPartitionedTables(const char *reltypes, const char
*pattern, bool verbose)
"n.nspname",
"c.relname", NULL,
"pg_catalog.pg_table_is_visible(c.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBuffer(&buf, "ORDER BY \"Schema\", %s%s\"Name\";",
mixed_output ? "\"Type\" DESC, " : "",
@@ -5813,12 +5423,6 @@ listLanguages(const char *pattern, bool verbose, bool
showSystem)
gettext_noop("Description"));
if (pattern)
-<<<<<<< HEAD
- if (!validateSQLNamePattern(&buf, pattern, false, false,
- NULL,
"l.lanname", NULL, NULL,
- NULL,
2))
- return false;
-=======
{
if (!validateSQLNamePattern(&buf, pattern, false, false,
NULL,
"l.lanname", NULL, NULL,
@@ -5828,7 +5432,6 @@ listLanguages(const char *pattern, bool verbose, bool
showSystem)
return false;
}
}
->>>>>>> REL_16_9
if (!showSystem && !pattern)
appendPQExpBufferStr(&buf, "WHERE l.lanplcallfoid != 0\n");
@@ -5914,14 +5517,10 @@ listDomains(const char *pattern, bool verbose, bool
showSystem)
"n.nspname",
"t.typname", NULL,
"pg_catalog.pg_type_is_visible(t.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
@@ -5997,14 +5596,10 @@ listConversions(const char *pattern, bool verbose, bool
showSystem)
"n.nspname",
"c.conname", NULL,
"pg_catalog.pg_conversion_is_visible(c.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
@@ -6151,14 +5746,10 @@ listEventTriggers(const char *pattern, bool verbose)
if (!validateSQLNamePattern(&buf, pattern, false, false,
NULL,
"evtname", NULL, NULL,
NULL, 1))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1");
@@ -6254,14 +5845,10 @@ listExtendedStats(const char *pattern)
"es.stxnamespace::pg_catalog.regnamespace::pg_catalog.text", "es.stxname",
NULL,
"pg_catalog.pg_statistics_obj_is_visible(es.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
@@ -6365,11 +5952,7 @@ listCasts(const char *pattern, bool verbose)
"pg_catalog.format_type(ts.oid, NULL)",
"pg_catalog.pg_type_is_visible(ts.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
goto error_return;
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, ") OR (true");
@@ -6378,11 +5961,7 @@ listCasts(const char *pattern, bool verbose)
"pg_catalog.format_type(tt.oid, NULL)",
"pg_catalog.pg_type_is_visible(tt.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
goto error_return;
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, ") )\nORDER BY 1, 2;");
@@ -6498,14 +6077,10 @@ listCollations(const char *pattern, bool verbose, bool
showSystem)
"n.nspname",
"c.collname", NULL,
"pg_catalog.pg_collation_is_visible(c.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
@@ -6568,11 +6143,7 @@ listSchemas(const char *pattern, bool verbose, bool
showSystem)
NULL,
"n.nspname", NULL,
NULL,
NULL, 2))
-<<<<<<< HEAD
- return false;
-=======
goto error_return;
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1;");
@@ -6685,14 +6256,10 @@ listTSParsers(const char *pattern, bool verbose)
"n.nspname",
"p.prsname", NULL,
"pg_catalog.pg_ts_parser_is_visible(p.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
@@ -6735,14 +6302,10 @@ listTSParsersVerbose(const char *pattern)
"n.nspname",
"p.prsname", NULL,
"pg_catalog.pg_ts_parser_is_visible(p.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
@@ -6954,14 +6517,10 @@ listTSDictionaries(const char *pattern, bool verbose)
"n.nspname",
"d.dictname", NULL,
"pg_catalog.pg_ts_dict_is_visible(d.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
@@ -7024,14 +6583,10 @@ listTSTemplates(const char *pattern, bool verbose)
"n.nspname",
"t.tmplname", NULL,
"pg_catalog.pg_ts_template_is_visible(t.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
@@ -7083,14 +6638,10 @@ listTSConfigs(const char *pattern, bool verbose)
"n.nspname",
"c.cfgname", NULL,
"pg_catalog.pg_ts_config_is_visible(c.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
@@ -7134,14 +6685,10 @@ listTSConfigsVerbose(const char *pattern)
"n.nspname",
"c.cfgname", NULL,
"pg_catalog.pg_ts_config_is_visible(c.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 3, 2;");
@@ -7314,14 +6861,10 @@ listForeignDataWrappers(const char *pattern, bool
verbose)
if (!validateSQLNamePattern(&buf, pattern, false, false,
NULL,
"fdwname", NULL, NULL,
NULL, 1))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1;");
@@ -7395,14 +6938,10 @@ listForeignServers(const char *pattern, bool verbose)
if (!validateSQLNamePattern(&buf, pattern, false, false,
NULL,
"s.srvname", NULL, NULL,
NULL, 1))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1;");
@@ -7455,14 +6994,10 @@ listUserMappings(const char *pattern, bool verbose)
if (!validateSQLNamePattern(&buf, pattern, false, false,
NULL,
"um.srvname", "um.usename", NULL,
NULL, 1))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
@@ -7532,14 +7067,10 @@ listForeignTables(const char *pattern, bool verbose)
"n.nspname",
"c.relname", NULL,
"pg_catalog.pg_table_is_visible(c.oid)",
NULL, 3))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
@@ -7570,19 +7101,6 @@ listExtensions(const char *pattern)
PGresult *res;
printQueryOpt myopt = pset.popt;
-<<<<<<< HEAD
- if (pset.sversion < 80300)
- {
- char sverbuf[32];
-
- pg_log_error("The server (version %s) does not support
extensions.",
- formatPGVersionNumber(pset.sversion,
false,
-
sverbuf, sizeof(sverbuf)));
- return true;
- }
-
-=======
->>>>>>> REL_16_9
initPQExpBuffer(&buf);
printfPQExpBuffer(&buf,
"SELECT e.extname AS \"%s\", "
@@ -7601,14 +7119,10 @@ listExtensions(const char *pattern)
NULL,
"e.extname", NULL,
NULL,
NULL, 1))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1;");
@@ -7639,34 +7153,6 @@ listExtensionContents(const char *pattern)
PGresult *res;
int i;
-<<<<<<< HEAD
- /*
- * In PostgreSQL, extension support added in 9.1, but it was backported
- * to GPDB 5, which is based on 8.3.
- */
- if (pset.sversion < 80300)
- {
- char sverbuf[32];
-
- pg_log_error("The server (version %s) does not support
extensions.",
- formatPGVersionNumber(pset.sversion,
false,
-
sverbuf, sizeof(sverbuf)));
- return true;
- }
-
- /*
- * The pg_desribe_object function is is needed \dx+. It was introduced
- * in PostgreSQL 9.1. That means that GPDB 5 didn't have it, even though
- * extensions support was backported. If we can't use
pg_describe_object,
- * print the same as plain \dx does.
- */
- if (pset.sversion < 90100)
- {
- return listExtensions(pattern);
- }
-
-=======
->>>>>>> REL_16_9
initPQExpBuffer(&buf);
printfPQExpBuffer(&buf,
"SELECT e.extname, e.oid\n"
@@ -7677,14 +7163,10 @@ listExtensionContents(const char *pattern)
NULL,
"e.extname", NULL,
NULL,
NULL, 1))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1;");
@@ -7783,11 +7265,7 @@ validateSQLNamePattern(PQExpBuffer buf, const char
*pattern, bool have_where,
const char *visibilityrule, bool
*added_clause,
int maxparts)
{
-<<<<<<< HEAD
- PQExpBufferData dbbuf;
-=======
PQExpBufferData dbbuf;
->>>>>>> REL_16_9
int dotcnt;
bool added;
@@ -7802,38 +7280,20 @@ validateSQLNamePattern(PQExpBuffer buf, const char
*pattern, bool have_where,
{
pg_log_error("improper qualified name (too many dotted names):
%s",
pattern);
-<<<<<<< HEAD
- termPQExpBuffer(&dbbuf);
- return false;
- }
-
- if (maxparts > 1 && dotcnt == maxparts-1)
-=======
goto error_return;
}
if (maxparts > 1 && dotcnt == maxparts - 1)
->>>>>>> REL_16_9
{
if (PQdb(pset.db) == NULL)
{
pg_log_error("You are currently not connected to a
database.");
-<<<<<<< HEAD
- return false;
-=======
goto error_return;
->>>>>>> REL_16_9
}
if (strcmp(PQdb(pset.db), dbbuf.data) != 0)
{
pg_log_error("cross-database references are not
implemented: %s",
pattern);
-<<<<<<< HEAD
- return false;
- }
- }
- return true;
-=======
goto error_return;
}
}
@@ -7843,7 +7303,6 @@ validateSQLNamePattern(PQExpBuffer buf, const char
*pattern, bool have_where,
error_return:
termPQExpBuffer(&dbbuf);
return false;
->>>>>>> REL_16_9
}
/*
@@ -7901,14 +7360,10 @@ listPublications(const char *pattern)
NULL,
"pubname", NULL,
NULL,
NULL, 1))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1;");
@@ -8023,14 +7478,10 @@ describePublications(const char *pattern)
NULL,
"pubname", NULL,
NULL,
NULL, 1))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 2;");
@@ -8264,14 +7715,10 @@ describeSubscriptions(const char *pattern, bool verbose)
NULL,
"subname", NULL,
NULL,
NULL, 1))
-<<<<<<< HEAD
- return false;
-=======
{
termPQExpBuffer(&buf);
return false;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1;");
@@ -8375,11 +7822,7 @@ listOperatorClasses(const char *access_method_pattern,
if (!validateSQLNamePattern(&buf, access_method_pattern,
false,
false, NULL, "am.amname", NULL, NULL,
&have_where, 1))
-<<<<<<< HEAD
- return false;
-=======
goto error_return;
->>>>>>> REL_16_9
if (type_pattern)
{
/* Match type name pattern against either internal or external
name */
@@ -8388,11 +7831,7 @@ listOperatorClasses(const char *access_method_pattern,
"pg_catalog.format_type(t.oid, NULL)",
"pg_catalog.pg_type_is_visible(t.oid)",
NULL,
3))
-<<<<<<< HEAD
- return false;
-=======
goto error_return;
->>>>>>> REL_16_9
}
appendPQExpBufferStr(&buf, "ORDER BY 1, 2, 4;");
@@ -8463,11 +7902,7 @@ listOperatorFamilies(const char *access_method_pattern,
if (!validateSQLNamePattern(&buf, access_method_pattern,
false,
false, NULL, "am.amname", NULL, NULL,
&have_where, 1))
-<<<<<<< HEAD
- return false;
-=======
goto error_return;
->>>>>>> REL_16_9
if (type_pattern)
{
appendPQExpBuffer(&buf,
@@ -8484,11 +7919,7 @@ listOperatorFamilies(const char *access_method_pattern,
"pg_catalog.format_type(t.oid, NULL)",
"pg_catalog.pg_type_is_visible(t.oid)",
NULL,
3))
-<<<<<<< HEAD
- return false;
-=======
goto error_return;
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, " )\n");
}
@@ -8570,23 +8001,11 @@ listOpFamilyOperators(const char *access_method_pattern,
" LEFT JOIN
pg_catalog.pg_opfamily ofs ON ofs.oid = o.amopsortfamily\n");
if (access_method_pattern)
-<<<<<<< HEAD
-=======
{
->>>>>>> REL_16_9
if (!validateSQLNamePattern(&buf, access_method_pattern,
false,
false, NULL, "am.amname",
NULL,
NULL,
&have_where, 1))
-<<<<<<< HEAD
- return false;
-
- if (family_pattern)
- if (!validateSQLNamePattern(&buf, family_pattern, have_where,
false,
-
"nsf.nspname", "of.opfname", NULL, NULL,
- NULL,
3))
- return false;
-=======
goto error_return;
}
@@ -8597,7 +8016,6 @@ listOpFamilyOperators(const char *access_method_pattern,
NULL,
3))
goto error_return;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1, 2,\n"
" o.amoplefttype =
o.amoprighttype DESC,\n"
@@ -8679,22 +8097,11 @@ listOpFamilyFunctions(const char *access_method_pattern,
" LEFT JOIN
pg_catalog.pg_proc p ON ap.amproc = p.oid\n");
if (access_method_pattern)
-<<<<<<< HEAD
-=======
{
->>>>>>> REL_16_9
if (!validateSQLNamePattern(&buf, access_method_pattern,
false,
false, NULL, "am.amname",
NULL,
NULL,
&have_where, 1))
-<<<<<<< HEAD
- return false;
- if (family_pattern)
- if (!validateSQLNamePattern(&buf, family_pattern, have_where,
false,
-
"ns.nspname", "of.opfname", NULL, NULL,
- NULL,
3))
- return false;
-=======
goto error_return;
}
if (family_pattern)
@@ -8704,7 +8111,6 @@ listOpFamilyFunctions(const char *access_method_pattern,
NULL,
3))
goto error_return;
}
->>>>>>> REL_16_9
appendPQExpBufferStr(&buf, "ORDER BY 1, 2,\n"
" ap.amproclefttype =
ap.amprocrighttype DESC,\n"
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index 21ecb6ebbaa..48c813e2ac0 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -72,15 +72,9 @@ usage(unsigned short int pager)
*/
initPQExpBuffer(&buf);
-<<<<<<< HEAD
- fprintf(output, _("psql is the PostgreSQL interactive terminal
(Cloudberry version).\n\n"));
- fprintf(output, _("Usage:\n"));
- fprintf(output, _(" psql [OPTION]... [DBNAME [USERNAME]]\n\n"));
-=======
- HELP0("psql is the PostgreSQL interactive terminal.\n\n");
+ HELP0("psql is the PostgreSQL interactive terminal (Cloudberry
version).\n\n");
HELP0("Usage:\n");
HELP0(" psql [OPTION]... [DBNAME [USERNAME]]\n\n");
->>>>>>> REL_16_9
HELP0("General options:\n");
/* Display default database */
@@ -103,32 +97,18 @@ usage(unsigned short int pager)
HELP0(" --help=commands list backslash commands, then
exit\n");
HELP0(" --help=variables list special variables, then exit\n");
-<<<<<<< HEAD
- fprintf(output, _("\nInput and output options:\n"));
- fprintf(output, _(" -a, --echo-all echo all input from
script\n"));
- fprintf(output, _(" -b, --echo-errors echo failed commands\n"));
- fprintf(output, _(" -e, --echo-queries echo commands sent to
server\n"));
- fprintf(output, _(" -E, --echo-hidden display queries that
internal commands generate\n"));
- fprintf(output, _(" -L, --log-file=FILENAME send session log to
file\n"));
- fprintf(output, _(" --ignore-log-file do not log psql:filename
prefix in log file\n"));
- fprintf(output, _(" -n, --no-readline disable enhanced command
line editing (readline)\n"));
- fprintf(output, _(" -o, --output=FILENAME send query results to
file (or |pipe)\n"));
- fprintf(output, _(" -q, --quiet run quietly (no messages,
only query output)\n"));
- fprintf(output, _(" -s, --single-step single-step mode (confirm
each query)\n"));
- fprintf(output, _(" -S, --single-line single-line mode (end of
line terminates SQL command)\n"));
-=======
HELP0("\nInput and output options:\n");
HELP0(" -a, --echo-all echo all input from script\n");
HELP0(" -b, --echo-errors echo failed commands\n");
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(" -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");
HELP0(" -s, --single-step single-step mode (confirm each
query)\n");
HELP0(" -S, --single-line single-line mode (end of line
terminates SQL command)\n");
->>>>>>> REL_16_9
HELP0("\nOutput format options:\n");
HELP0(" -A, --no-align unaligned table output mode\n");
@@ -209,11 +189,7 @@ slashUsage(unsigned short int pager)
* To avoid counting the output lines manually, build the output in
"buf"
* and then count them.
*/
-<<<<<<< HEAD
- output = PageOutput(136, pager ? &(pset.popt.topt) : NULL);
-=======
initPQExpBuffer(&buf);
->>>>>>> REL_16_9
HELP0("General\n");
HELP0(" \\bind [PARAM]... set query parameters\n");
@@ -267,64 +243,6 @@ slashUsage(unsigned short int pager)
HELP0(" \\endif end conditional block\n");
HELP0("\n");
-<<<<<<< HEAD
- fprintf(output, _("Informational\n"));
- fprintf(output, _(" (options: S = show system objects, + = additional
detail)\n"));
- fprintf(output, _(" \\d[S+] list tables, views, and
sequences\n"));
- fprintf(output, _(" \\d[S+] NAME describe table, view,
sequence, or index\n"));
- fprintf(output, _(" \\da[S] [PATTERN] list aggregates\n"));
- fprintf(output, _(" \\dA[+] [PATTERN] list access methods\n"));
- fprintf(output, _(" \\dAc[+] [AMPTRN [TYPEPTRN]] list operator
classes\n"));
- fprintf(output, _(" \\dAf[+] [AMPTRN [TYPEPTRN]] list operator
families\n"));
- fprintf(output, _(" \\dAo[+] [AMPTRN [OPFPTRN]] list operators of
operator families\n"));
- fprintf(output, _(" \\dAp[+] [AMPTRN [OPFPTRN]] list support
functions of operator families\n"));
- fprintf(output, _(" \\db[+] [PATTERN] list tablespaces\n"));
- fprintf(output, _(" \\dc[S+] [PATTERN] list conversions\n"));
- fprintf(output, _(" \\dC[+] [PATTERN] list casts\n"));
- fprintf(output, _(" \\dd[S] [PATTERN] show object descriptions
not displayed elsewhere\n"));
- fprintf(output, _(" \\dD[S+] [PATTERN] list domains\n"));
- fprintf(output, _(" \\ddp [PATTERN] list default
privileges\n"));
- fprintf(output, _(" \\dE[S+] [PATTERN] list foreign tables\n"));
- fprintf(output, _(" \\des[+] [PATTERN] list foreign servers\n"));
- fprintf(output, _(" \\det[+] [PATTERN] list foreign tables\n"));
- fprintf(output, _(" \\deu[+] [PATTERN] list user mappings\n"));
- fprintf(output, _(" \\dew[+] [PATTERN] list foreign-data
wrappers\n"));
- fprintf(output, _(" \\df[anptw][S+] [FUNCPTRN [TYPEPTRN ...]]\n"
- " list [only
agg/normal/procedure/trigger/window] functions\n"));
- fprintf(output, _(" \\dF[+] [PATTERN] list text search
configurations\n"));
- fprintf(output, _(" \\dFd[+] [PATTERN] list text search
dictionaries\n"));
- fprintf(output, _(" \\dFp[+] [PATTERN] list text search
parsers\n"));
- fprintf(output, _(" \\dFt[+] [PATTERN] list text search
templates\n"));
- fprintf(output, _(" \\dg[S+] [PATTERN] list roles\n"));
- fprintf(output, _(" \\di[S+] [PATTERN] list indexes\n"));
- fprintf(output, _(" \\dl list large objects, same
as \\lo_list\n"));
- fprintf(output, _(" \\dL[S+] [PATTERN] list procedural
languages\n"));
- fprintf(output, _(" \\dm[S+] [PATTERN] list materialized
views\n"));
- fprintf(output, _(" \\dn[S+] [PATTERN] list schemas\n"));
- fprintf(output, _(" \\do[S+] [OPPTRN [TYPEPTRN [TYPEPTRN]]]\n"
- " list
operators\n"));
- fprintf(output, _(" \\dO[S+] [PATTERN] list collations\n"));
- fprintf(output, _(" \\dp [PATTERN] list table, view, and
sequence access privileges\n"));
- fprintf(output, _(" \\dP[itn+] [PATTERN] list [only index/table]
partitioned relations [n=nested]\n"));
- fprintf(output, _(" \\drds [ROLEPTRN [DBPTRN]] list per-database role
settings\n"));
- fprintf(output, _(" \\dRp[+] [PATTERN] list replication
publications\n"));
- fprintf(output, _(" \\dRs[+] [PATTERN] list replication
subscriptions\n"));
- fprintf(output, _(" \\ds[S+] [PATTERN] list sequences\n"));
- fprintf(output, _(" \\dt[S+] [PATTERN] list tables\n"));
- fprintf(output, _(" \\dT[S+] [PATTERN] list data types\n"));
- fprintf(output, _(" \\du[S+] [PATTERN] list roles\n"));
- fprintf(output, _(" \\dv[S+] [PATTERN] list views\n"));
- /* In GPDB and CBDB, we use \dE for both external and foreign tables. */
- fprintf(output, _(" \\dE[S+] [PATTERN] list foreign and external
tables\n"));
- fprintf(output, _(" \\dx[+] [PATTERN] list extensions\n"));
- fprintf(output, _(" \\dX [PATTERN] list extended
statistics\n"));
- fprintf(output, _(" \\dy[+] [PATTERN] list event triggers\n"));
- fprintf(output, _(" \\l[+] [PATTERN] list databases\n"));
- fprintf(output, _(" \\sf[+] FUNCNAME show a function's
definition\n"));
- fprintf(output, _(" \\sv[+] VIEWNAME show a view's
definition\n"));
- fprintf(output, _(" \\z [PATTERN] same as \\dp\n"));
- fprintf(output, "\n");
-=======
HELP0("Informational\n");
HELP0(" (options: S = show system objects, + = additional detail)\n");
HELP0(" \\d[S+] list tables, views, and sequences\n");
@@ -373,6 +291,7 @@ slashUsage(unsigned short int pager)
HELP0(" \\dT[S+] [PATTERN] list data types\n");
HELP0(" \\du[S+] [PATTERN] list roles\n");
HELP0(" \\dv[S+] [PATTERN] list views\n");
+ HELP0(" \\dE[S+] [PATTERN] list foreign and external tables\n");
HELP0(" \\dx[+] [PATTERN] list extensions\n");
HELP0(" \\dX [PATTERN] list extended statistics\n");
HELP0(" \\dy[+] [PATTERN] list event triggers\n");
@@ -381,7 +300,6 @@ slashUsage(unsigned short int pager)
HELP0(" \\sv[+] VIEWNAME show a view's definition\n");
HELP0(" \\z[S] [PATTERN] same as \\dp\n");
HELP0("\n");
->>>>>>> REL_16_9
HELP0("Large Objects\n");
HELP0(" \\lo_export LOBOID FILE write large object to file\n");
@@ -473,11 +391,7 @@ helpVariables(unsigned short int pager)
* To avoid counting the output lines manually, build the output in
"buf"
* and then count them.
*/
-<<<<<<< HEAD
- output = PageOutput(160, pager ? &(pset.popt.topt) : NULL);
-=======
initPQExpBuffer(&buf);
->>>>>>> REL_16_9
HELP0("List of specially treated variables\n\n");
@@ -844,21 +758,15 @@ helpSQL(const char *topic, unsigned short int pager)
void
print_copyright(void)
{
-<<<<<<< HEAD
puts(
"Apache Cloudberry (Incubating)\n"
"Copyright 2024-2025 The Apache Software Foundation\n\n"
"Greenplum Database version of PostgreSQL Database Management
System\n"
- "Portions Copyright (c) 1996-2020, PostgreSQL Global
Development Group\n\n"
+ "Portions Copyright (c) 1996-2023, PostgreSQL Global
Development Group\n\n"
"Portions Copyright (c) 2014-Present VMware, Inc. or its
affiliates.\n\n"
"Portions Copyright (c) 2011-2014 EMC\n\n"
"This software is based on Postgres95, formerly known as
Postgres, which\n"
"contains the following notice:\n\n"
-=======
- puts("PostgreSQL Database Management System\n"
- "(formerly known as Postgres, then as Postgres95)\n\n"
- "Portions Copyright (c) 1996-2023, PostgreSQL Global
Development Group\n\n"
->>>>>>> REL_16_9
"Portions Copyright (c) 1994, The Regents of the University of
California\n\n"
"Permission to use, copy, modify, and distribute this software
and its\n"
"documentation for any purpose, without fee, and without a
written agreement\n"
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index a996db12576..47dfcf3a6e3 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -1,13 +1,9 @@
/*
* psql - the PostgreSQL interactive terminal
*
-<<<<<<< HEAD
* Portions Copyright (c) 2005-2010, Greenplum inc
* Portions Copyright (c) 2012-Present VMware, Inc. or its affiliates.
- * Copyright (c) 2000-2021, PostgreSQL Global Development Group
-=======
* Copyright (c) 2000-2023, PostgreSQL Global Development Group
->>>>>>> REL_16_9
*
* src/bin/psql/tab-complete.c
*/
@@ -43,6 +39,8 @@
#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
@@ -390,15 +388,12 @@ do { \
matches = rl_completion_matches(text, complete_from_schema_query); \
} while (0)
-<<<<<<< HEAD
-=======
#define COMPLETE_WITH_ATTR_PLUS(relation, ...) \
do { \
static const char *const list[] = { __VA_ARGS__, NULL }; \
COMPLETE_WITH_ATTR_LIST(relation, list); \
} while (0)
->>>>>>> REL_16_9
/*
* libedit will typically include the literal's leading single quote in
* "text", while readline will not. Adapt our offered strings to fit.
@@ -407,37 +402,6 @@ do { \
*/
#define COMPLETE_WITH_ENUM_VALUE(type) \
do { \
-<<<<<<< HEAD
- char *_completion_schema; \
- char *_completion_type; \
- bool use_quotes; \
-\
- _completion_schema = strtokx(type, " \t\n\r", ".", "\"", 0, \
- false, false,
pset.encoding); \
- (void) strtokx(NULL, " \t\n\r", ".", "\"", 0, \
- false, false, pset.encoding); \
- _completion_type = strtokx(NULL, " \t\n\r", ".", "\"", 0, \
- false, false,
pset.encoding); \
- use_quotes = (text[0] == '\'' || \
- start == 0 || rl_line_buffer[start - 1] !=
'\''); \
- if (_completion_type == NULL) \
- { \
- if (use_quotes) \
- completion_charp =
Query_for_list_of_enum_values_quoted; \
- else \
- completion_charp =
Query_for_list_of_enum_values_unquoted; \
- completion_info_charp = type; \
- } \
- else \
- { \
- if (use_quotes) \
- completion_charp =
Query_for_list_of_enum_values_with_schema_quoted; \
- else \
- completion_charp =
Query_for_list_of_enum_values_with_schema_unquoted; \
- completion_info_charp = _completion_type; \
- completion_info_charp2 = _completion_schema; \
- } \
-=======
set_completion_reference(type); \
if (text[0] == '\'' || \
start == 0 || rl_line_buffer[start - 1] != '\'') \
@@ -464,7 +428,6 @@ do { \
completion_charp = Query_for_list_of_timezone_names_unquoted; \
completion_charpp = list;
\
completion_verbatim = true; \
->>>>>>> REL_16_9
matches = rl_completion_matches(text, complete_from_query); \
} while (0)
@@ -956,12 +919,8 @@ static const SchemaQuery Query_for_list_of_clusterables = {
.catname = "pg_catalog.pg_class c",
.selcondition =
"c.relkind IN (" CppAsString2(RELKIND_RELATION) ", "
-<<<<<<< HEAD
CppAsString2(RELKIND_MATVIEW) ", "
CppAsString2(RELKIND_DIRECTORY_TABLE) ")",
-=======
CppAsString2(RELKIND_PARTITIONED_TABLE) ", "
- CppAsString2(RELKIND_MATVIEW) ")",
->>>>>>> REL_16_9
.viscondition = "pg_catalog.pg_table_is_visible(c.oid)",
.namespace = "c.relnamespace",
.result = "c.relname",
@@ -1038,84 +997,6 @@ static const SchemaQuery Query_for_trigger_of_table = {
* that way is always the wrong thing. Make a SchemaQuery instead.
*/
-<<<<<<< HEAD
-#define Query_for_list_of_attributes \
-"SELECT pg_catalog.quote_ident(attname) "\
-" FROM pg_catalog.pg_attribute a, pg_catalog.pg_class c "\
-" WHERE c.oid = a.attrelid "\
-" AND a.attnum > 0 "\
-" AND NOT a.attisdropped "\
-" AND substring(pg_catalog.quote_ident(attname),1,%d)='%s' "\
-" AND (pg_catalog.quote_ident(relname)='%s' "\
-" OR '\"' || relname || '\"'='%s') "\
-" AND pg_catalog.pg_table_is_visible(c.oid)"
-
-#define Query_for_list_of_attribute_numbers \
-"SELECT attnum "\
-" FROM pg_catalog.pg_attribute a, pg_catalog.pg_class c "\
-" WHERE c.oid = a.attrelid "\
-" AND a.attnum > 0 "\
-" AND NOT a.attisdropped "\
-" AND substring(attnum::pg_catalog.text,1,%d)='%s' "\
-" AND (pg_catalog.quote_ident(relname)='%s' "\
-" OR '\"' || relname || '\"'='%s') "\
-" AND pg_catalog.pg_table_is_visible(c.oid)"
-
-#define Query_for_list_of_attributes_with_schema \
-"SELECT pg_catalog.quote_ident(attname) "\
-" FROM pg_catalog.pg_attribute a, pg_catalog.pg_class c,
pg_catalog.pg_namespace n "\
-" WHERE c.oid = a.attrelid "\
-" AND n.oid = c.relnamespace "\
-" AND a.attnum > 0 "\
-" AND NOT a.attisdropped "\
-" AND substring(pg_catalog.quote_ident(attname),1,%d)='%s' "\
-" AND (pg_catalog.quote_ident(relname)='%s' "\
-" OR '\"' || relname || '\"' ='%s') "\
-" AND (pg_catalog.quote_ident(nspname)='%s' "\
-" OR '\"' || nspname || '\"' ='%s') "
-
-#define Query_for_list_of_enum_values_quoted \
-"SELECT pg_catalog.quote_literal(enumlabel) "\
-" FROM pg_catalog.pg_enum e, pg_catalog.pg_type t "\
-" WHERE t.oid = e.enumtypid "\
-" AND substring(pg_catalog.quote_literal(enumlabel),1,%d)='%s' "\
-" AND (pg_catalog.quote_ident(typname)='%s' "\
-" OR '\"' || typname || '\"'='%s') "\
-" AND pg_catalog.pg_type_is_visible(t.oid)"
-
-#define Query_for_list_of_enum_values_unquoted \
-"SELECT enumlabel "\
-" FROM pg_catalog.pg_enum e, pg_catalog.pg_type t "\
-" WHERE t.oid = e.enumtypid "\
-" AND substring(enumlabel,1,%d)='%s' "\
-" AND (pg_catalog.quote_ident(typname)='%s' "\
-" OR '\"' || typname || '\"'='%s') "\
-" AND pg_catalog.pg_type_is_visible(t.oid)"
-
-#define Query_for_list_of_enum_values_with_schema_quoted \
-"SELECT pg_catalog.quote_literal(enumlabel) "\
-" FROM pg_catalog.pg_enum e, pg_catalog.pg_type t, pg_catalog.pg_namespace n
"\
-" WHERE t.oid = e.enumtypid "\
-" AND n.oid = t.typnamespace "\
-" AND substring(pg_catalog.quote_literal(enumlabel),1,%d)='%s' "\
-" AND (pg_catalog.quote_ident(typname)='%s' "\
-" OR '\"' || typname || '\"'='%s') "\
-" AND (pg_catalog.quote_ident(nspname)='%s' "\
-" OR '\"' || nspname || '\"' ='%s') "
-
-#define Query_for_list_of_enum_values_with_schema_unquoted \
-"SELECT enumlabel "\
-" FROM pg_catalog.pg_enum e, pg_catalog.pg_type t, pg_catalog.pg_namespace n
"\
-" WHERE t.oid = e.enumtypid "\
-" AND n.oid = t.typnamespace "\
-" AND substring(enumlabel,1,%d)='%s' "\
-" AND (pg_catalog.quote_ident(typname)='%s' "\
-" OR '\"' || typname || '\"'='%s') "\
-" AND (pg_catalog.quote_ident(nspname)='%s' "\
-" OR '\"' || nspname || '\"' ='%s') "
-
-=======
->>>>>>> REL_16_9
#define Query_for_list_of_template_databases \
"SELECT d.datname "\
" FROM pg_catalog.pg_database d "\
@@ -1181,84 +1062,8 @@ static const SchemaQuery Query_for_trigger_of_table = {
#define Query_for_all_table_constraints \
"SELECT conname "\
" FROM pg_catalog.pg_constraint c "\
-<<<<<<< HEAD
-" WHERE c.conrelid <> 0 "
-
-/* the silly-looking length condition is just to eat up the current word */
-#define Query_for_constraint_of_type \
-"SELECT pg_catalog.quote_ident(conname) "\
-" FROM pg_catalog.pg_type t, pg_catalog.pg_constraint con "\
-" WHERE t.oid=contypid and (%d = pg_catalog.length('%s'))"\
-" and pg_catalog.quote_ident(t.typname)='%s'"\
-" and pg_catalog.pg_type_is_visible(t.oid)"
-
-/* the silly-looking length condition is just to eat up the current word */
-#define Query_for_list_of_tables_for_constraint \
-"SELECT pg_catalog.quote_ident(relname) "\
-" FROM pg_catalog.pg_class"\
-" WHERE (%d = pg_catalog.length('%s'))"\
-" AND oid IN "\
-" (SELECT conrelid FROM pg_catalog.pg_constraint "\
-" WHERE pg_catalog.quote_ident(conname)='%s')"
-
-/* the silly-looking length condition is just to eat up the current word */
-#define Query_for_rule_of_table \
-"SELECT pg_catalog.quote_ident(rulename) "\
-" FROM pg_catalog.pg_class c1, pg_catalog.pg_rewrite "\
-" WHERE c1.oid=ev_class and (%d = pg_catalog.length('%s'))"\
-" and pg_catalog.quote_ident(c1.relname)='%s'"\
-" and pg_catalog.pg_table_is_visible(c1.oid)"
-
-/* the silly-looking length condition is just to eat up the current word */
-#define Query_for_list_of_tables_for_rule \
-"SELECT pg_catalog.quote_ident(relname) "\
-" FROM pg_catalog.pg_class"\
-" WHERE (%d = pg_catalog.length('%s'))"\
-" AND oid IN "\
-" (SELECT ev_class FROM pg_catalog.pg_rewrite "\
-" WHERE pg_catalog.quote_ident(rulename)='%s')"
-
-/* the silly-looking length condition is just to eat up the current word */
-#define Query_for_trigger_of_table \
-"SELECT pg_catalog.quote_ident(tgname) "\
-" FROM pg_catalog.pg_class c1, pg_catalog.pg_trigger "\
-" WHERE c1.oid=tgrelid and (%d = pg_catalog.length('%s'))"\
-" and pg_catalog.quote_ident(c1.relname)='%s'"\
-" and pg_catalog.pg_table_is_visible(c1.oid)"\
-" and not tgisinternal"
-
-/* the silly-looking length condition is just to eat up the current word */
-#define Query_for_list_of_tables_for_trigger \
-"SELECT pg_catalog.quote_ident(relname) "\
-" FROM pg_catalog.pg_class"\
-" WHERE (%d = pg_catalog.length('%s'))"\
-" AND oid IN "\
-" (SELECT tgrelid FROM pg_catalog.pg_trigger "\
-" WHERE pg_catalog.quote_ident(tgname)='%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_ts_configurations \
-"SELECT pg_catalog.quote_ident(cfgname) FROM pg_catalog.pg_ts_config "\
-" WHERE substring(pg_catalog.quote_ident(cfgname),1,%d)='%s'"
-
-#define Query_for_list_of_ts_dictionaries \
-"SELECT pg_catalog.quote_ident(dictname) FROM pg_catalog.pg_ts_dict "\
-" WHERE substring(pg_catalog.quote_ident(dictname),1,%d)='%s'"
-
-#define Query_for_list_of_ts_parsers \
-"SELECT pg_catalog.quote_ident(prsname) FROM pg_catalog.pg_ts_parser "\
-" WHERE substring(pg_catalog.quote_ident(prsname),1,%d)='%s'"
-
-#define Query_for_list_of_ts_templates \
-"SELECT pg_catalog.quote_ident(tmplname) FROM pg_catalog.pg_ts_template "\
-" WHERE substring(pg_catalog.quote_ident(tmplname),1,%d)='%s'"
-=======
" WHERE c.conrelid <> 0 "\
" and conname LIKE '%s'"
->>>>>>> REL_16_9
#define Query_for_list_of_fdws \
" SELECT fdwname "\
@@ -1459,14 +1264,9 @@ static const pgsql_thing_t words_after_create[] = {
{"CONFIGURATION", NULL, NULL, &Query_for_list_of_ts_configurations,
NULL, THING_NO_SHOW},
{"CONVERSION", "SELECT conname FROM pg_catalog.pg_conversion WHERE
conname LIKE '%s'"},
{"DATABASE", Query_for_list_of_databases},
-<<<<<<< HEAD
- {"DEFAULT PRIVILEGES", NULL, NULL, NULL, THING_NO_CREATE |
THING_NO_DROP},
- {"DICTIONARY", Query_for_list_of_ts_dictionaries, NULL, NULL,
THING_NO_SHOW},
- {"DIRECTORY TABLE", NULL, NULL, &Query_for_list_of_directory_tables},
-=======
{"DEFAULT PRIVILEGES", NULL, NULL, NULL, NULL, THING_NO_CREATE |
THING_NO_DROP},
{"DICTIONARY", NULL, NULL, &Query_for_list_of_ts_dictionaries, NULL,
THING_NO_SHOW},
->>>>>>> REL_16_9
+ {"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},
{"EVENT TRIGGER", NULL, NULL, NULL},
@@ -1503,21 +1303,13 @@ static const pgsql_thing_t words_after_create[] = {
{"SYSTEM", NULL, NULL, NULL, NULL, THING_NO_CREATE | THING_NO_DROP},
{"TABLE", NULL, NULL, &Query_for_list_of_tables},
{"TABLESPACE", Query_for_list_of_tablespaces},
-<<<<<<< HEAD
{"TAG", Query_for_list_of_tags},
{"TASK", Query_for_list_of_tasks},
- {"TEMP", NULL, NULL, NULL, THING_NO_DROP | THING_NO_ALTER}, /* for
CREATE TEMP TABLE
-
* ... */
- {"TEMPLATE", Query_for_list_of_ts_templates, NULL, NULL, THING_NO_SHOW},
- {"TEMPORARY", NULL, NULL, NULL, THING_NO_DROP | THING_NO_ALTER},
/* for CREATE TEMPORARY
-
* TABLE ... */
-=======
{"TEMP", NULL, NULL, NULL, NULL, THING_NO_DROP | THING_NO_ALTER},
/* for CREATE TEMP TABLE
* ... */
{"TEMPLATE", NULL, NULL, &Query_for_list_of_ts_templates, NULL,
THING_NO_SHOW},
{"TEMPORARY", NULL, NULL, NULL, NULL, THING_NO_DROP | THING_NO_ALTER},
/* for CREATE TEMPORARY
*
TABLE ... */
->>>>>>> REL_16_9
{"TEXT SEARCH", NULL, NULL, NULL},
{"TRANSFORM", NULL, NULL, NULL, NULL, THING_NO_ALTER},
{"TRIGGER", "SELECT tgname FROM pg_catalog.pg_trigger WHERE tgname LIKE
'%s' AND NOT tgisinternal"},
@@ -1942,13 +1734,8 @@ psql_completion(const char *text, int start, int end)
"COMMENT", "COMMIT", "COPY", "CREATE", "DEALLOCATE", "DECLARE",
"DELETE FROM", "DISCARD", "DO", "DROP", "END", "EXECUTE",
"EXPLAIN",
"FETCH", "GRANT", "IMPORT FOREIGN SCHEMA", "INSERT INTO",
"LISTEN", "LOAD", "LOCK",
-<<<<<<< HEAD
- "MOVE", "NOTIFY", "PREPARE",
- "REASSIGN", "REFRESH MATERIALIZED VIEW", "REFRESH DYNAMIC
TABLE", "REINDEX", "RELEASE",
-=======
"MERGE INTO", "MOVE", "NOTIFY", "PREPARE",
- "REASSIGN", "REFRESH MATERIALIZED VIEW", "REINDEX", "RELEASE",
->>>>>>> REL_16_9
+ "REASSIGN", "REFRESH MATERIALIZED VIEW", "REFRESH DYNAMIC
TABLE", "REINDEX", "RELEASE",
"RESET", "REVOKE", "ROLLBACK",
"SAVEPOINT", "SECURITY LABEL", "SELECT", "SET", "SHOW", "START",
"TABLE", "TRUNCATE", "UNLISTEN", "UPDATE", "VACUUM", "VALUES",
"WITH",
@@ -2090,7 +1877,6 @@ psql_completion(const char *text, int start, int end)
else
COMPLETE_WITH_FUNCTION_ARG(prev2_wd);
}
-<<<<<<< HEAD
/* ALTER TAG <name > (...) */
else if (Matches("ALTER", "TAG"))
{
@@ -2104,12 +1890,8 @@ psql_completion(const char *text, int start, int end)
{
COMPLETE_WITH("OWNER TO", "RENAME TO", "UNSET ALLOWED_VALUES",
"ADD ALLOWED_VLAUES", "DROP ALLOWED_VLAUES");
}
- /* ALTER FUNCTION,PROCEDURE,ROUTINE <name> (...) */
- else if (Matches("ALTER", "FUNCTION|PROCEDURE|ROUTINE", MatchAny,
MatchAny))
-=======
/* ALTER FUNCTION <name> (...) */
else if (Matches("ALTER", "FUNCTION", MatchAny, MatchAny))
->>>>>>> REL_16_9
{
if (ends_with(prev_wd, ')'))
COMPLETE_WITH(Alter_function_options);
@@ -2619,12 +2401,9 @@ psql_completion(const char *text, int start, int end)
"ENABLE", "INHERIT", "NO", "RENAME",
"RESET",
"OWNER TO", "SET", "VALIDATE
CONSTRAINT",
"REPLICA IDENTITY", "ATTACH
PARTITION",
-<<<<<<< HEAD
- "DETACH PARTITION", "FORCE ROW LEVEL
SECURITY",
- "EXCHANGE", "TRUNCATE");
-=======
"DETACH PARTITION", "FORCE ROW LEVEL
SECURITY",
- "OF", "NOT OF");
+ "OF", "NOT OF",
+ "EXCHANGE", "TRUNCATE");
/* ALTER TABLE xxx ADD */
else if (Matches("ALTER", "TABLE", MatchAny, "ADD"))
{
@@ -2672,7 +2451,6 @@ psql_completion(const char *text, int start, int end)
set_completion_reference(prev7_wd);
COMPLETE_WITH_SCHEMA_QUERY(Query_for_unique_index_of_table);
}
->>>>>>> REL_16_9
/* ALTER TABLE xxx ENABLE */
else if (Matches("ALTER", "TABLE", MatchAny, "ENABLE"))
COMPLETE_WITH("ALWAYS", "REPLICA", "ROW LEVEL SECURITY", "RULE",
@@ -2828,11 +2606,7 @@ psql_completion(const char *text, int start, int end)
"TABLESPACE", "UNLOGGED", "WITH",
"WITHOUT");
/*
-<<<<<<< HEAD
- * If we have ALTER TABLE <smt> SET ACCESS METHOD provide a list of
table
-=======
* If we have ALTER TABLE <sth> SET ACCESS METHOD provide a list of
table
->>>>>>> REL_16_9
* AMs.
*/
else if (Matches("ALTER", "TABLE", MatchAny, "SET", "ACCESS", "METHOD"))
@@ -2888,20 +2662,16 @@ psql_completion(const char *text, int start, int end)
}
else if (Matches("ALTER", "TABLE", MatchAny, "DETACH", "PARTITION",
MatchAny))
COMPLETE_WITH("CONCURRENTLY", "FINALIZE");
-<<<<<<< HEAD
/* ALTER TABLE <foo> EXCHANGE, provide partition options */
else if (Matches("ALTER", "TABLE", MatchAny, "EXCHANGE"))
COMPLETE_WITH("PARTITION FOR (" , "DEFAULT PARTITION");
/* ALTER TABLE <foo> TRUNCATE, provide partition options */
else if (Matches("ALTER", "TABLE", MatchAny, "TRUNCATE"))
COMPLETE_WITH("PARTITION FOR (" , "DEFAULT PARTITION");
-=======
-
/* ALTER TABLE <name> OF */
else if (Matches("ALTER", "TABLE", MatchAny, "OF"))
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_composite_datatypes);
->>>>>>> REL_16_9
/* ALTER TABLESPACE <foo> with RENAME TO, OWNER TO, SET, RESET */
else if (Matches("ALTER", "TABLESPACE", MatchAny))
COMPLETE_WITH("RENAME TO", "OWNER TO", "SET", "RESET");
@@ -3063,18 +2833,6 @@ psql_completion(const char *text, int start, int end)
else if (Matches("COMMENT"))
COMPLETE_WITH("ON");
else if (Matches("COMMENT", "ON"))
-<<<<<<< HEAD
- COMPLETE_WITH("ACCESS METHOD", "CAST", "COLLATION",
"CONVERSION",
- "DATABASE", "EVENT TRIGGER",
"EXTENSION",
- "FOREIGN DATA WRAPPER", "FOREIGN
TABLE", "SERVER",
- "INDEX", "LANGUAGE", "POLICY",
"PUBLICATION", "RULE",
- "SCHEMA", "SEQUENCE", "STATISTICS",
"SUBSCRIPTION",
- "TABLE", "TYPE", "VIEW",
"MATERIALIZED VIEW", "DYNAMIC TABLE",
- "COLUMN", "AGGREGATE", "FUNCTION",
"STORAGE SERVER",
- "PROCEDURE", "PROFILE", "ROUTINE",
- "OPERATOR", "TRIGGER", "CONSTRAINT",
"DOMAIN",
- "LARGE OBJECT", "TABLESPACE", "TAG",
"TEXT SEARCH", "ROLE");
-=======
COMPLETE_WITH("ACCESS METHOD", "AGGREGATE", "CAST", "COLLATION",
"COLUMN", "CONSTRAINT", "CONVERSION",
"DATABASE",
"DOMAIN", "EXTENSION", "EVENT
TRIGGER",
@@ -3085,8 +2843,8 @@ psql_completion(const char *text, int start, int end)
"ROUTINE", "RULE", "SCHEMA",
"SEQUENCE", "SERVER",
"STATISTICS", "SUBSCRIPTION", "TABLE",
"TABLESPACE", "TEXT SEARCH",
"TRANSFORM FOR",
- "TRIGGER", "TYPE", "VIEW");
->>>>>>> REL_16_9
+ "TRIGGER", "TYPE", "VIEW", "DYNAMIC
TABLE",
+ "STORAGE SERVER", "PROFILE", "TAG");
else if (Matches("COMMENT", "ON", "ACCESS", "METHOD"))
COMPLETE_WITH_QUERY(Query_for_list_of_access_methods);
else if (Matches("COMMENT", "ON", "CONSTRAINT"))
@@ -5221,13 +4979,9 @@ psql_completion(const char *text, int start, int end)
else if (TailMatchesCS("\\dm*"))
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_matviews);
else if (TailMatchesCS("\\dE*"))
-<<<<<<< HEAD
- COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_foreign_tables,
NULL);
- else if (TailMatchesCS("\\dY*"))
- COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_directory_tables,
NULL);
-=======
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_foreign_tables);
->>>>>>> REL_16_9
+ else if (TailMatchesCS("\\dY*"))
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_directory_tables);
else if (TailMatchesCS("\\dy*"))
COMPLETE_WITH_QUERY(Query_for_list_of_event_triggers);
@@ -5397,10 +5151,6 @@ psql_completion(const char *text, int start, int end)
{
COMPLETE_WITH_CONST(true, "");
/* Also, prevent Readline from appending stuff to the non-match
*/
-<<<<<<< HEAD
-#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
-=======
->>>>>>> REL_16_9
rl_completion_append_character = '\0';
#ifdef HAVE_RL_COMPLETION_SUPPRESS_QUOTE
rl_completion_suppress_quote = 1;
@@ -5672,23 +5422,11 @@ _complete_from_query(const char *simple_query,
Assert(simple_query == NULL);
/*
-<<<<<<< HEAD
- * When fetching relation names, suppress system
catalogs unless
- * the input-so-far begins with "pg_" or "gp_". This
is a compromise
- * between not offering system catalogs for completion
at all, and
- * having them swamp the result when the input is just
"p".
- */
- if (strcmp(schema_query->catname,
- "pg_catalog.pg_class c") == 0 &&
- strncmp(text, "pg_", 3) != 0 &&
- strncmp(text, "gp_", 3) != 0)
-=======
* We issue different queries depending on whether the
input is
* already qualified or not. schema_query gives us the
pieces to
* assemble.
*/
if (schemaname == NULL || schema_query->namespace ==
NULL)
->>>>>>> REL_16_9
{
/* Get unqualified names matching the
input-so-far */
appendPQExpBufferStr(&query_buffer, "SELECT ");
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]