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
4b6fcc44
Commit
4b6fcc44
authored
Apr 05, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove GetDatabaseName/Path and use globals. Make consts later.
parent
9e45687d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
40 deletions
+16
-40
src/backend/commands/dbcommands.c
src/backend/commands/dbcommands.c
+2
-2
src/backend/storage/buffer/bufmgr.c
src/backend/storage/buffer/bufmgr.c
+2
-2
src/backend/storage/file/fd.c
src/backend/storage/file/fd.c
+3
-5
src/backend/utils/init/miscinit.c
src/backend/utils/init/miscinit.c
+1
-24
src/backend/utils/init/postinit.c
src/backend/utils/init/postinit.c
+4
-4
src/include/miscadmin.h
src/include/miscadmin.h
+4
-3
No files found.
src/backend/commands/dbcommands.c
View file @
4b6fcc44
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.
9 1998/03/30 17:22:58
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.
10 1998/04/05 21:04:12
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -229,7 +229,7 @@ check_permissions(char *command,
...
@@ -229,7 +229,7 @@ check_permissions(char *command,
}
}
/* Check to make sure database is not the currently open database */
/* Check to make sure database is not the currently open database */
if
(
!
strcmp
(
dbname
,
GetDatabaseName
()
))
if
(
!
strcmp
(
dbname
,
DatabaseName
))
{
{
elog
(
ERROR
,
"%s cannot be executed on an open database"
,
command
);
elog
(
ERROR
,
"%s cannot be executed on an open database"
,
command
);
}
}
...
...
src/backend/storage/buffer/bufmgr.c
View file @
4b6fcc44
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.3
5 1998/02/26 04:35:24
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.3
6 1998/04/05 21:04:22
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -643,7 +643,7 @@ BufferAlloc(Relation reln,
...
@@ -643,7 +643,7 @@ BufferAlloc(Relation reln,
/* record the database name and relation name for this buffer */
/* record the database name and relation name for this buffer */
strcpy
(
buf
->
sb_relname
,
reln
->
rd_rel
->
relname
.
data
);
strcpy
(
buf
->
sb_relname
,
reln
->
rd_rel
->
relname
.
data
);
strcpy
(
buf
->
sb_dbname
,
GetDatabaseName
()
);
strcpy
(
buf
->
sb_dbname
,
DatabaseName
);
INIT_BUFFERTAG
(
&
(
buf
->
tag
),
reln
,
blockNum
);
INIT_BUFFERTAG
(
&
(
buf
->
tag
),
reln
,
blockNum
);
if
(
!
BufTableInsert
(
buf
))
if
(
!
BufTableInsert
(
buf
))
...
...
src/backend/storage/file/fd.c
View file @
4b6fcc44
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Id: fd.c,v 1.3
0 1998/02/26 04:35:29
momjian Exp $
* $Id: fd.c,v 1.3
1 1998/04/05 21:04:27
momjian Exp $
*
*
* NOTES:
* NOTES:
*
*
...
@@ -460,8 +460,6 @@ FreeVfd(File file)
...
@@ -460,8 +460,6 @@ FreeVfd(File file)
* Open specified file name.
* Open specified file name.
* Fill in absolute path fields if necessary.
* Fill in absolute path fields if necessary.
*
*
* Modify to use GetDatabasePath() rather than hardcoded paths.
* - thomas 1997-11-02
*/
*/
static
char
*
static
char
*
filepath
(
char
*
filename
)
filepath
(
char
*
filename
)
...
@@ -472,9 +470,9 @@ filepath(char *filename)
...
@@ -472,9 +470,9 @@ filepath(char *filename)
/* Not an absolute path name? Then fill in with database path... */
/* Not an absolute path name? Then fill in with database path... */
if
(
*
filename
!=
SEP_CHAR
)
if
(
*
filename
!=
SEP_CHAR
)
{
{
len
=
strlen
(
GetDatabasePath
()
)
+
strlen
(
filename
)
+
2
;
len
=
strlen
(
DatabasePath
)
+
strlen
(
filename
)
+
2
;
buf
=
(
char
*
)
palloc
(
len
);
buf
=
(
char
*
)
palloc
(
len
);
sprintf
(
buf
,
"%s%c%s"
,
GetDatabasePath
()
,
SEP_CHAR
,
filename
);
sprintf
(
buf
,
"%s%c%s"
,
DatabasePath
,
SEP_CHAR
,
filename
);
}
}
else
else
{
{
...
...
src/backend/utils/init/miscinit.c
View file @
4b6fcc44
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.1
3 1998/04/05 05:51:58
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.1
4 1998/04/05 21:04:36
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -47,9 +47,7 @@
...
@@ -47,9 +47,7 @@
extern
char
*
getenv
(
const
char
*
name
);
/* XXX STDLIB */
extern
char
*
getenv
(
const
char
*
name
);
/* XXX STDLIB */
/* from globals.c */
/* from globals.c */
extern
char
*
DatabaseName
;
extern
char
*
UserName
;
extern
char
*
UserName
;
extern
char
*
DatabasePath
;
#ifdef CYR_RECODE
#ifdef CYR_RECODE
unsigned
char
RecodeForwTable
[
128
];
unsigned
char
RecodeForwTable
[
128
];
...
@@ -224,27 +222,6 @@ GetProcessingMode()
...
@@ -224,27 +222,6 @@ GetProcessingMode()
* ----------------------------------------------------------------
* ----------------------------------------------------------------
*/
*/
/*
* GetDatabasePath --
* Returns path to database.
*
*/
const
char
*
GetDatabasePath
()
{
return
DatabasePath
;
}
/*
* GetDatabaseName --
* Returns name of database.
*/
const
char
*
GetDatabaseName
()
{
return
DatabaseName
;
}
void
void
SetDatabasePath
(
char
*
path
)
SetDatabasePath
(
char
*
path
)
{
{
...
...
src/backend/utils/init/postinit.c
View file @
4b6fcc44
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.2
6 1998/04/05 05:52:00
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/postinit.c,v 1.2
7 1998/04/05 21:04:43
momjian Exp $
*
*
* NOTES
* NOTES
* InitPostgres() is the function called from PostgresMain
* InitPostgres() is the function called from PostgresMain
...
@@ -126,7 +126,7 @@ InitMyDatabaseInfo(char *name)
...
@@ -126,7 +126,7 @@ InitMyDatabaseInfo(char *name)
if
(
!
OidIsValid
(
MyDatabaseId
))
if
(
!
OidIsValid
(
MyDatabaseId
))
elog
(
FATAL
,
elog
(
FATAL
,
"Database %s does not exist in %s"
,
"Database %s does not exist in %s"
,
GetDatabaseName
()
,
DatabaseName
,
DatabaseRelationName
);
DatabaseRelationName
);
path
=
ExpandDatabasePath
(
myPath
);
path
=
ExpandDatabasePath
(
myPath
);
...
@@ -203,8 +203,8 @@ VerifyMyDatabase()
...
@@ -203,8 +203,8 @@ VerifyMyDatabase()
int
fd
;
int
fd
;
char
errormsg
[
1000
];
char
errormsg
[
1000
];
name
=
GetDatabaseName
()
;
name
=
DatabaseName
;
myPath
=
GetDatabasePath
()
;
myPath
=
DatabasePath
;
if
((
fd
=
open
(
myPath
,
O_RDONLY
,
0
))
==
-
1
)
if
((
fd
=
open
(
myPath
,
O_RDONLY
,
0
))
==
-
1
)
sprintf
(
errormsg
,
sprintf
(
errormsg
,
...
...
src/include/miscadmin.h
View file @
4b6fcc44
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: miscadmin.h,v 1.2
1 1998/04/05 05:52:1
0 momjian Exp $
* $Id: miscadmin.h,v 1.2
2 1998/04/05 21:04:5
0 momjian Exp $
*
*
* NOTES
* NOTES
* some of the information in this file will be moved to
* some of the information in this file will be moved to
...
@@ -110,14 +110,15 @@ extern Oid LastOidProcessed; /* for query rewrite */
...
@@ -110,14 +110,15 @@ extern Oid LastOidProcessed; /* for query rewrite */
* POSTGRES directory path definitions. *
* POSTGRES directory path definitions. *
*****************************************************************************/
*****************************************************************************/
extern
char
*
DatabaseName
;
extern
char
*
DatabasePath
;
/* in utils/misc/database.c */
/* in utils/misc/database.c */
extern
void
GetRawDatabaseInfo
(
char
*
name
,
Oid
*
owner
,
Oid
*
db_id
,
char
*
path
);
extern
void
GetRawDatabaseInfo
(
char
*
name
,
Oid
*
owner
,
Oid
*
db_id
,
char
*
path
);
extern
int
GetDatabaseInfo
(
char
*
name
,
Oid
*
owner
,
char
*
path
);
extern
int
GetDatabaseInfo
(
char
*
name
,
Oid
*
owner
,
char
*
path
);
extern
char
*
ExpandDatabasePath
(
char
*
path
);
extern
char
*
ExpandDatabasePath
(
char
*
path
);
/* now in utils/init/miscinit.c */
/* now in utils/init/miscinit.c */
extern
const
char
*
GetDatabasePath
(
void
);
extern
const
char
*
GetDatabaseName
(
void
);
extern
void
SetDatabaseName
(
char
*
name
);
extern
void
SetDatabaseName
(
char
*
name
);
extern
void
SetDatabasePath
(
char
*
path
);
extern
void
SetDatabasePath
(
char
*
path
);
extern
char
*
getpgusername
(
void
);
extern
char
*
getpgusername
(
void
);
...
...
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