=== Applying patches on top of PostgreSQL commit ID 53a49365052026907afff7613929710d1e7f0da0 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Sat Feb 1 06:53:26 UTC 2025 On branch cf/3256 nothing to commit, working tree clean === applying patch ./0001-Add-pg_am_size-pg_namespace_size.patch Applied patch to 'doc/src/sgml/func.sgml' cleanly. Applied patch to 'src/backend/utils/adt/dbsize.c' cleanly. Applied patch to 'src/include/catalog/pg_proc.dat' cleanly. [cf/3256 e220d04436] Add pg_am_size(), pg_namespace_size() .. Author: Justin Pryzby Date: Tue Jul 13 21:25:48 2021 -0500 3 files changed, 190 insertions(+) === applying patch ./0002-psql-add-convenience-commands-dA-and-dn.patch Applied patch to 'src/bin/psql/command.c' with conflicts. Applied patch to 'src/bin/psql/describe.c' cleanly. Applied patch to 'src/bin/psql/describe.h' cleanly. U src/bin/psql/command.c diff --cc src/bin/psql/command.c index 6c75c8da6d,14c772c18f..0000000000 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@@ -377,10 -370,8 +377,15 @@@ exec_command(const char *cmd else if (strcmp(cmd, "if") == 0) status = exec_command_if(scan_state, cstack, query_buf); else if (strcmp(cmd, "l") == 0 || strcmp(cmd, "list") == 0 || ++<<<<<<< ours + strcmp(cmd, "lx") == 0 || strcmp(cmd, "listx") == 0 || + strcmp(cmd, "l+") == 0 || strcmp(cmd, "list+") == 0 || + strcmp(cmd, "lx+") == 0 || strcmp(cmd, "listx+") == 0 || + strcmp(cmd, "l+x") == 0 || strcmp(cmd, "list+x") == 0) ++======= + strcmp(cmd, "l++") == 0 || strcmp(cmd, "list++") == 0 || + strcmp(cmd, "l+") == 0 || strcmp(cmd, "list+") == 0) ++>>>>>>> theirs status = exec_command_list(scan_state, active_branch, cmd); else if (strncmp(cmd, "lo_", 3) == 0) status = exec_command_lo(scan_state, active_branch, cmd); @@@ -853,27 -758,20 +858,31 @@@ exec_command_d(PsqlScanState scan_state if (active_branch) { char *pattern; + int verbose = 0; bool show_verbose, show_system; + unsigned short int save_expanded; /* We don't do SQLID reduction on the pattern yet */ pattern = psql_scan_slash_option(scan_state, OT_NORMAL, NULL, true); - show_verbose = strchr(cmd, '+') ? true : false; + for (const char *t = cmd; *t != '\0'; ++t) + verbose += *t == '+' ? 1 : 0; + + show_verbose = (bool) (verbose != 0); show_system = strchr(cmd, 'S') ? true : false; + /* + * The 'x' option turns expanded mode on for this command only. This + * is allowed in all \d* commands, except \d by itself, since \dx is a + * separate command. So the 'x' option cannot appear immediately after + * \d, but it can appear after \d followed by other options. + */ + save_expanded = pset.popt.topt.expanded; + if (cmd[1] != '\0' && strchr(&cmd[2], 'x')) + pset.popt.topt.expanded = 1; + switch (cmd[1]) { case '\0': @@@ -896,8 -794,7 +905,12 @@@ { case '\0': case '+': ++<<<<<<< ours + case 'x': + success = describeAccessMethods(pattern, show_verbose); ++======= + success = describeAccessMethods(pattern, verbose); ++>>>>>>> theirs break; case 'c': success = listOperatorClasses(pattern, pattern2, show_verbose); @@@ -2066,23 -1957,15 +2079,32 @@@ exec_command_list(PsqlScanState scan_st if (active_branch) { char *pattern; ++<<<<<<< ours + bool show_verbose; + unsigned short int save_expanded; ++======= + int verbose = 0; ++>>>>>>> theirs pattern = psql_scan_slash_option(scan_state, OT_NORMAL, NULL, true); - show_verbose = strchr(cmd, '+') ? true : false; + for (const char *t = cmd; *t != '\0'; ++t) + verbose += *t == '+' ? 1 : 0; ++<<<<<<< ours + /* if 'x' option specified, force expanded mode */ + save_expanded = pset.popt.topt.expanded; + if (strchr(cmd, 'x')) + pset.popt.topt.expanded = 1; + + success = listAllDbs(pattern, show_verbose); ++======= + success = listAllDbs(pattern, verbose); ++>>>>>>> theirs + + /* restore original expanded mode */ + pset.popt.topt.expanded = save_expanded; free(pattern); }