Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
7d1b8fe7
Commit
7d1b8fe7
authored
Mar 07, 2002
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Back out psql domain improvements until domain is applied.
parent
b976b8af
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
60 deletions
+4
-60
src/bin/psql/command.c
src/bin/psql/command.c
+1
-5
src/bin/psql/describe.c
src/bin/psql/describe.c
+1
-49
src/bin/psql/describe.h
src/bin/psql/describe.h
+1
-4
src/bin/psql/help.c
src/bin/psql/help.c
+1
-2
No files found.
src/bin/psql/command.c
View file @
7d1b8fe7
...
...
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.6
8 2002/03/06 20:39:45
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.6
9 2002/03/07 17:54:39
momjian Exp $
*/
#include "postgres_fe.h"
#include "command.h"
...
...
@@ -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
;
}
...
...
src/bin/psql/describe.c
View file @
7d1b8fe7
...
...
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.4
4 2002/03/06 20:39:45
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.4
5 2002/03/07 17:54:39
momjian Exp $
*/
#include "postgres_fe.h"
#include "describe.h"
...
...
@@ -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
;
}
src/bin/psql/describe.h
View file @
7d1b8fe7
...
...
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/bin/psql/describe.h,v 1.1
4 2002/03/06 20:39:45
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/describe.h,v 1.1
5 2002/03/07 17:54:41
momjian Exp $
*/
#ifndef DESCRIBE_H
#define 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 */
src/bin/psql/help.c
View file @
7d1b8fe7
...
...
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.4
5 2002/03/06 20:39:45
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.4
6 2002/03/07 17:54:42
momjian Exp $
*/
#include "postgres_fe.h"
#include "help.h"
...
...
@@ -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
"
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment