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
3ca998b9
Commit
3ca998b9
authored
Aug 20, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow psql to use 7.4.X database by not referencing tablespaces.
Greg Sabino Mullan
parent
ee85595d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
8 deletions
+19
-8
src/bin/psql/describe.c
src/bin/psql/describe.c
+13
-5
src/bin/psql/settings.h
src/bin/psql/settings.h
+2
-2
src/bin/psql/startup.c
src/bin/psql/startup.c
+4
-1
No files found.
src/bin/psql/describe.c
View file @
3ca998b9
...
...
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.10
3 2004/07/15 03:56:06
momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.10
4 2004/08/20 20:18:23
momjian Exp $
*/
#include "postgres_fe.h"
#include "describe.h"
...
...
@@ -112,6 +112,12 @@ describeTablespaces(const char *pattern, bool verbose)
PGresult
*
res
;
printQueryOpt
myopt
=
pset
.
popt
;
if
(
pset
.
sversion
<
70500
)
{
fprintf
(
stderr
,
_
(
"This server version (%d) does not support tablespaces.
\n
"
),
pset
.
sversion
);
return
true
;
}
initPQExpBuffer
(
&
buf
);
printfPQExpBuffer
(
&
buf
,
...
...
@@ -706,8 +712,9 @@ describeOneTableDetails(const char *schemaname,
/* Get general table info */
printfPQExpBuffer
(
&
buf
,
"SELECT relhasindex, relkind, relchecks, reltriggers, relhasrules,
\n
"
"relhasoids
, reltablespace
\n
"
"relhasoids
%s
\n
"
"FROM pg_catalog.pg_class WHERE oid = '%s'"
,
pset
.
sversion
>=
70500
?
", reltablespace"
:
""
,
oid
);
res
=
PSQLexec
(
buf
.
data
,
false
);
if
(
!
res
)
...
...
@@ -729,7 +736,8 @@ describeOneTableDetails(const char *schemaname,
tableinfo
.
hasindex
=
strcmp
(
PQgetvalue
(
res
,
0
,
0
),
"t"
)
==
0
;
tableinfo
.
hasrules
=
strcmp
(
PQgetvalue
(
res
,
0
,
4
),
"t"
)
==
0
;
tableinfo
.
hasoids
=
strcmp
(
PQgetvalue
(
res
,
0
,
5
),
"t"
)
==
0
;
tableinfo
.
tablespace
=
atooid
(
PQgetvalue
(
res
,
0
,
6
));
tableinfo
.
tablespace
=
(
pset
.
sversion
>=
70500
)
?
atooid
(
PQgetvalue
(
res
,
0
,
6
))
:
0
;
PQclear
(
res
);
headers
[
0
]
=
_
(
"Column"
);
...
...
@@ -932,8 +940,8 @@ describeOneTableDetails(const char *schemaname,
footers
=
pg_malloc_zero
(
4
*
sizeof
(
*
footers
));
footers
[
count_footers
++
]
=
pg_strdup
(
tmpbuf
.
data
);
add_tablespace_footer
(
tableinfo
.
relkind
,
tableinfo
.
tablespace
,
footers
,
&
count_footers
,
tmpbuf
);
add_tablespace_footer
(
tableinfo
.
relkind
,
tableinfo
.
tablespace
,
footers
,
&
count_footers
,
tmpbuf
);
footers
[
count_footers
]
=
NULL
;
}
...
...
src/bin/psql/settings.h
View file @
3ca998b9
...
...
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/settings.h,v 1.1
8 2004/05/12 13:38:45
momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/settings.h,v 1.1
9 2004/08/20 20:18:23
momjian Exp $
*/
#ifndef SETTINGS_H
#define SETTINGS_H
...
...
@@ -41,7 +41,7 @@ typedef struct _psqlSettings
FILE
*
cur_cmd_source
;
/* describe the status of the current main
* loop */
bool
cur_cmd_interactive
;
int
sversion
;
/* backend server version */
const
char
*
progname
;
/* in case you renamed psql */
char
*
inputfile
;
/* for error reporting */
unsigned
lineno
;
/* also for error reporting */
...
...
src/bin/psql/startup.c
View file @
3ca998b9
...
...
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.9
6 2004/08/18 02:59:11
momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.9
7 2004/08/20 20:18:23
momjian Exp $
*/
#include "postgres_fe.h"
...
...
@@ -217,6 +217,9 @@ main(int argc, char *argv[])
SyncVariables
();
/* Grab the backend server version */
pset
.
sversion
=
PQserverVersion
(
pset
.
db
);
if
(
options
.
action
==
ACT_LIST_DB
)
{
int
success
=
listAllDbs
(
false
);
...
...
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