Skip to content

Commit 7d1b8fe

Browse files
committed
Back out psql domain improvements until domain is applied.
1 parent b976b8a commit 7d1b8fe

File tree

4 files changed

+4
-60
lines changed

4 files changed

+4
-60
lines changed

src/bin/psql/command.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.68 2002/03/06 20:39:45 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.69 2002/03/07 17:54:39 momjian Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "command.h"
@@ -380,10 +380,6 @@ exec_command(const char *cmd,
380380
case 'u':
381381
success = describeUsers(name);
382382
break;
383-
case 'D':
384-
success = listDomains(name);
385-
break;
386-
387383
default:
388384
status = CMD_UNKNOWN;
389385
}

src/bin/psql/describe.c

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.44 2002/03/06 20:39:45 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.45 2002/03/07 17:54:39 momjian Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "describe.h"
@@ -1036,51 +1036,3 @@ listTables(const char *infotype, const char *name, bool desc)
10361036
PQclear(res);
10371037
return true;
10381038
}
1039-
1040-
/*
1041-
* \dD [domain]
1042-
*
1043-
* Describes domains, possibly based on a simplistic prefix search on the
1044-
* argument.
1045-
*/
1046-
1047-
bool
1048-
listDomains(const char *name)
1049-
{
1050-
char buf[512 + REGEXP_CUTOFF];
1051-
PGresult *res;
1052-
printQueryOpt myopt = pset.popt;
1053-
1054-
snprintf(buf, sizeof(buf),
1055-
"SELECT t.typname as \"%s\",\n"
1056-
" format_type( t.typbasetype, t.typmod) as \"%s\",\n"
1057-
" CASE WHEN t.typnotnull AND t.typdefault IS NOT NULL THEN 'not null default '||t.typdefault\n"
1058-
" WHEN t.typnotnull AND t.typdefault IS NULL THEN 'not null'\n"
1059-
" WHEN NOT t.typnotnull AND t.typdefault IS NOT NULL THEN 'default '||t.typdefault\n"
1060-
" ELSE ''\n"
1061-
" END as \"%s\"\n"
1062-
"FROM pg_type t\n"
1063-
"WHERE t.typtype = 'd'\n",
1064-
_("Name"),
1065-
_("Type"),
1066-
_("Modifier"));
1067-
if (name)
1068-
{
1069-
strcat(buf, "AND t.typname ~ '^");
1070-
strncat(buf, name, REGEXP_CUTOFF);
1071-
strcat(buf, "'\n");
1072-
}
1073-
strcat(buf, "ORDER BY 1;");
1074-
1075-
res = PSQLexec(buf);
1076-
if (!res)
1077-
return false;
1078-
1079-
myopt.nullPrint = NULL;
1080-
myopt.title = _("List of database domains");
1081-
1082-
printQuery(res, &myopt, pset.queryFout);
1083-
1084-
PQclear(res);
1085-
return true;
1086-
}

src/bin/psql/describe.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/describe.h,v 1.14 2002/03/06 20:39:45 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/describe.h,v 1.15 2002/03/07 17:54:41 momjian Exp $
77
*/
88
#ifndef DESCRIBE_H
99
#define DESCRIBE_H
@@ -40,7 +40,4 @@ bool listAllDbs(bool desc);
4040
/* \dt, \di, \ds, \dS, etc. */
4141
bool listTables(const char *infotype, const char *name, bool desc);
4242

43-
/* \dD */
44-
bool listDomains(const char *name);
45-
4643
#endif /* DESCRIBE_H */

src/bin/psql/help.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.45 2002/03/06 20:39:45 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.46 2002/03/07 17:54:42 momjian Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "help.h"
@@ -202,7 +202,6 @@ slashUsage(void)
202202
fprintf(fout, _(" \\d{p|S|l} list access privileges, system tables, or large objects\n"));
203203
fprintf(fout, _(" \\da list aggregate functions\n"));
204204
fprintf(fout, _(" \\dd NAME show comment for table, type, function, or operator\n"));
205-
fprintf(fout, _(" \\dD [NAME] list domains\n"));
206205
fprintf(fout, _(" \\df list functions\n"));
207206
fprintf(fout, _(" \\do list operators\n"));
208207
fprintf(fout, _(" \\dT list data types\n"));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy