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
e9ad14f9
Commit
e9ad14f9
authored
May 14, 2010
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use NAMEDATALEN instead of local define.
Modify path separators for Win32. Per ideas from Takahiro Itagaki
parent
36d3afd2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
24 deletions
+18
-24
contrib/pg_upgrade/exec.c
contrib/pg_upgrade/exec.c
+3
-3
contrib/pg_upgrade/file.c
contrib/pg_upgrade/file.c
+0
-6
contrib/pg_upgrade/option.c
contrib/pg_upgrade/option.c
+6
-2
contrib/pg_upgrade/pg_upgrade.h
contrib/pg_upgrade/pg_upgrade.h
+7
-11
contrib/pg_upgrade/version_old_8_3.c
contrib/pg_upgrade/version_old_8_3.c
+2
-2
No files found.
contrib/pg_upgrade/exec.c
View file @
e9ad14f9
...
...
@@ -138,7 +138,7 @@ check_exec(migratorContext *ctx, const char *dir, const char *cmdName)
char
path
[
MAXPGPATH
];
const
char
*
errMsg
;
snprintf
(
path
,
sizeof
(
path
),
"%s
%c%s"
,
dir
,
pathSeparato
r
,
cmdName
);
snprintf
(
path
,
sizeof
(
path
),
"%s
/%s"
,
di
r
,
cmdName
);
if
((
errMsg
=
validate_exec
(
path
))
==
NULL
)
return
1
;
/* 1 -> first alternative OK */
...
...
@@ -286,8 +286,8 @@ check_data_dir(migratorContext *ctx, const char *pg_data)
{
struct
stat
statBuf
;
snprintf
(
subDirName
,
sizeof
(
subDirName
),
"%s
%c
%s"
,
pg_data
,
pathSeparator
,
requiredSubdirs
[
subdirnum
]);
snprintf
(
subDirName
,
sizeof
(
subDirName
),
"%s
/
%s"
,
pg_data
,
requiredSubdirs
[
subdirnum
]);
if
((
stat
(
subDirName
,
&
statBuf
))
!=
0
)
{
...
...
contrib/pg_upgrade/file.c
View file @
e9ad14f9
...
...
@@ -13,12 +13,6 @@
#include <windows.h>
#endif
#ifndef WIN32
char
pathSeparator
=
'/'
;
#else
char
pathSeparator
=
'\\'
;
#endif
static
int
copy_file
(
const
char
*
fromfile
,
const
char
*
tofile
,
bool
force
);
...
...
contrib/pg_upgrade/option.c
View file @
e9ad14f9
...
...
@@ -308,9 +308,13 @@ validateDirectoryOption(migratorContext *ctx, char **dirpath,
/*
* Trim off any trailing path separators
*/
if
((
*
dirpath
)[
strlen
(
*
dirpath
)
-
1
]
==
pathSeparator
)
#ifndef WIN32
if
((
*
dirpath
)[
strlen
(
*
dirpath
)
-
1
]
==
'/'
)
#else
if
((
*
dirpath
)[
strlen
(
*
dirpath
)
-
1
]
==
'/'
||
(
*
dirpath
)[
strlen
(
*
dirpath
)
-
1
]
==
'\\'
)
#endif
(
*
dirpath
)[
strlen
(
*
dirpath
)
-
1
]
=
0
;
}
...
...
contrib/pg_upgrade/pg_upgrade.h
View file @
e9ad14f9
...
...
@@ -16,8 +16,6 @@
#include "libpq-fe.h"
/* Allocate for null byte */
#define NAMEDATASIZE (NAMEDATALEN + 1)
#define USER_NAME_SIZE 128
#define MAX_STRING 1024
...
...
@@ -73,15 +71,13 @@ extern int pgunlink(const char *path);
extern
void
copydir
(
char
*
fromdir
,
char
*
todir
,
bool
recurse
);
extern
bool
rmtree
(
const
char
*
path
,
bool
rmtopdir
);
extern
char
pathSeparator
;
/*
* Each relation is represented by a relinfo structure.
*/
typedef
struct
{
char
nspname
[
NAMEDATA
SIZE
];
/* namespace name */
char
relname
[
NAMEDATA
SIZE
];
/* relation name */
char
nspname
[
NAMEDATA
LEN
];
/* namespace name */
char
relname
[
NAMEDATA
LEN
];
/* relation name */
Oid
reloid
;
/* relation oid */
Oid
relfilenode
;
/* relation relfile node */
Oid
toastrelid
;
/* oid of the toast relation */
...
...
@@ -103,10 +99,10 @@ typedef struct
Oid
new
;
/* Relfilenode of the new relation */
char
old_file
[
MAXPGPATH
];
char
new_file
[
MAXPGPATH
];
char
old_nspname
[
NAMEDATA
SIZE
];
/* old name of the namespace */
char
old_relname
[
NAMEDATA
SIZE
];
/* old name of the relation */
char
new_nspname
[
NAMEDATA
SIZE
];
/* new name of the namespace */
char
new_relname
[
NAMEDATA
SIZE
];
/* new name of the relation */
char
old_nspname
[
NAMEDATA
LEN
];
/* old name of the namespace */
char
old_relname
[
NAMEDATA
LEN
];
/* old name of the relation */
char
new_nspname
[
NAMEDATA
LEN
];
/* new name of the namespace */
char
new_relname
[
NAMEDATA
LEN
];
/* new name of the relation */
}
FileNameMap
;
/*
...
...
@@ -115,7 +111,7 @@ typedef struct
typedef
struct
{
Oid
db_oid
;
/* oid of the database */
char
db_name
[
NAMEDATA
SIZE
];
/* database name */
char
db_name
[
NAMEDATA
LEN
];
/* database name */
char
db_tblspace
[
MAXPGPATH
];
/* database default tablespace path */
RelInfoArr
rel_arr
;
/* array of all user relinfos */
}
DbInfo
;
...
...
contrib/pg_upgrade/version_old_8_3.c
View file @
e9ad14f9
...
...
@@ -318,8 +318,8 @@ old_8_3_rebuild_tsvector_tables(migratorContext *ctx, bool check_mode,
{
PGresult
*
res
;
bool
db_used
=
false
;
char
old_nspname
[
NAMEDATA
SIZE
]
=
""
,
old_relname
[
NAMEDATA
SIZE
]
=
""
;
char
old_nspname
[
NAMEDATA
LEN
]
=
""
,
old_relname
[
NAMEDATA
LEN
]
=
""
;
int
ntups
;
int
rowno
;
int
i_nspname
,
...
...
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