From 2b1e2f252d39dae725314fee1b256239510490d1 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 7 Mar 2002 17:54:42 +0000 Subject: [PATCH] Back out psql domain improvements until domain is applied. --- src/bin/psql/command.c | 4 ---- src/bin/psql/describe.c | 48 ----------------------------------------- src/bin/psql/describe.h | 3 --- src/bin/psql/help.c | 1 - 4 files changed, 56 deletions(-) diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index a1ca03df55..90da4ee91c 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -380,10 +380,6 @@ exec_command(const char *cmd, case 'u': success = describeUsers(name); break; - case 'D': - success = listDomains(name); - break; - default: status = CMD_UNKNOWN; } diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 74d41a371b..a98de98afc 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -1036,51 +1036,3 @@ listTables(const char *infotype, const char *name, bool desc) PQclear(res); return true; } - -/* - * \dD [domain] - * - * Describes domains, possibly based on a simplistic prefix search on the - * argument. - */ - -bool -listDomains(const char *name) -{ - char buf[512 + REGEXP_CUTOFF]; - PGresult *res; - printQueryOpt myopt = pset.popt; - - snprintf(buf, sizeof(buf), - "SELECT t.typname as \"%s\",\n" - " format_type( t.typbasetype, t.typmod) as \"%s\",\n" - " CASE WHEN t.typnotnull AND t.typdefault IS NOT NULL THEN 'not null default '||t.typdefault\n" - " WHEN t.typnotnull AND t.typdefault IS NULL THEN 'not null'\n" - " WHEN NOT t.typnotnull AND t.typdefault IS NOT NULL THEN 'default '||t.typdefault\n" - " ELSE ''\n" - " END as \"%s\"\n" - "FROM pg_type t\n" - "WHERE t.typtype = 'd'\n", - _("Name"), - _("Type"), - _("Modifier")); - if (name) - { - strcat(buf, "AND t.typname ~ '^"); - strncat(buf, name, REGEXP_CUTOFF); - strcat(buf, "'\n"); - } - strcat(buf, "ORDER BY 1;"); - - res = PSQLexec(buf); - if (!res) - return false; - - myopt.nullPrint = NULL; - myopt.title = _("List of database domains"); - - printQuery(res, &myopt, pset.queryFout); - - PQclear(res); - return true; -} diff --git a/src/bin/psql/describe.h b/src/bin/psql/describe.h index 8adbd3b72e..943a4ce2d5 100644 --- a/src/bin/psql/describe.h +++ b/src/bin/psql/describe.h @@ -40,7 +40,4 @@ bool listAllDbs(bool desc); /* \dt, \di, \ds, \dS, etc. */ bool listTables(const char *infotype, const char *name, bool desc); -/* \dD */ -bool listDomains(const char *name); - #endif /* DESCRIBE_H */ diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c index 2bfc426bf1..5fde7c6c89 100644 --- a/src/bin/psql/help.c +++ b/src/bin/psql/help.c @@ -202,7 +202,6 @@ slashUsage(void) fprintf(fout, _(" \\d{p|S|l} list access privileges, system tables, or large objects\n")); fprintf(fout, _(" \\da list aggregate functions\n")); fprintf(fout, _(" \\dd NAME show comment for table, type, function, or operator\n")); - fprintf(fout, _(" \\dD [NAME] list domains\n")); fprintf(fout, _(" \\df list functions\n")); fprintf(fout, _(" \\do list operators\n")); fprintf(fout, _(" \\dT list data types\n")); -- 2.39.5