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
17befd6c
Commit
17befd6c
authored
Nov 12, 1996
by
Bryan Henderson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use new utils/version.c instead of backend/utils/init/magic.c.
parent
bbe89089
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
370 additions
and
354 deletions
+370
-354
src/backend/Makefile
src/backend/Makefile
+5
-3
src/backend/postmaster/postmaster.c
src/backend/postmaster/postmaster.c
+17
-7
src/backend/utils/init/Makefile
src/backend/utils/init/Makefile
+2
-2
src/backend/utils/init/postinit.c
src/backend/utils/init/postinit.c
+307
-296
src/bin/pg_version/Makefile
src/bin/pg_version/Makefile
+23
-9
src/bin/pg_version/pg_version.c
src/bin/pg_version/pg_version.c
+15
-19
src/include/miscadmin.h
src/include/miscadmin.h
+1
-18
No files found.
src/backend/Makefile
View file @
17befd6c
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
#
#
#
#
# IDENTIFICATION
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.1
4 1996/11/03 09:05:30
bryanh Exp $
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.1
5 1996/11/12 06:46:04
bryanh Exp $
#
#
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
...
@@ -131,7 +131,8 @@ OBJS = access/SUBSYS.o bootstrap/SUBSYS.o catalog/SUBSYS.o \
...
@@ -131,7 +131,8 @@ OBJS = access/SUBSYS.o bootstrap/SUBSYS.o catalog/SUBSYS.o \
lib/SUBSYS.o libpq/SUBSYS.o main/SUBSYS.o nodes/SUBSYS.o
\
lib/SUBSYS.o libpq/SUBSYS.o main/SUBSYS.o nodes/SUBSYS.o
\
optimizer/SUBSYS.o parser/SUBSYS.o port/SUBSYS.o
\
optimizer/SUBSYS.o parser/SUBSYS.o port/SUBSYS.o
\
postmaster/SUBSYS.o regex/SUBSYS.o rewrite/SUBSYS.o
\
postmaster/SUBSYS.o regex/SUBSYS.o rewrite/SUBSYS.o
\
storage/SUBSYS.o tcop/SUBSYS.o utils/SUBSYS.o
storage/SUBSYS.o tcop/SUBSYS.o utils/SUBSYS.o
\
../utils/version.o
ifdef
TIOGA
ifdef
TIOGA
OBJS
+=
tioga/SUBSYS.o
OBJS
+=
tioga/SUBSYS.o
...
@@ -139,7 +140,7 @@ endif
...
@@ -139,7 +140,7 @@ endif
all
:
postgres global1.bki.source local1_template1.bki.source
all
:
postgres global1.bki.source local1_template1.bki.source
postgres
:
postgres_group1 postgres_group2 postgres_group3 postgres_group4
postgres
:
postgres_group1 postgres_group2 postgres_group3 postgres_group4
$(CC)
$(LDFLAGS)
-o
postgres
$(OBJS)
$(LDADD)
$(CC)
$(LDFLAGS)
-o
postgres
$(OBJS)
$(LDADD)
postgres_group1
:
postgres_group1
:
...
@@ -167,6 +168,7 @@ postgres_group4:
...
@@ -167,6 +168,7 @@ postgres_group4:
ifdef
TIOGA
ifdef
TIOGA
$(MAKE)
-C
tioga all
$(MAKE)
-C
tioga all
endif
endif
$(MAKE)
-C
../utils version.o
global1.bki.source local1_template1.bki.source
:
global1.bki.source local1_template1.bki.source
:
$(MAKE)
-C
catalog
$@
$(MAKE)
-C
catalog
$@
...
...
src/backend/postmaster/postmaster.c
View file @
17befd6c
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.2
3 1996/11/10 03:01:41 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.2
4 1996/11/12 06:46:36 bryanh
Exp $
*
*
* NOTES
* NOTES
*
*
...
@@ -75,6 +75,7 @@
...
@@ -75,6 +75,7 @@
#include "libpq/auth.h"
#include "libpq/auth.h"
#include "libpq/pqcomm.h"
#include "libpq/pqcomm.h"
#include "miscadmin.h"
#include "miscadmin.h"
#include "version.h"
#include "lib/dllist.h"
#include "lib/dllist.h"
#include "nodes/nodes.h"
#include "nodes/nodes.h"
#include "utils/mcxt.h"
#include "utils/mcxt.h"
...
@@ -1186,18 +1187,27 @@ checkDataDir(void)
...
@@ -1186,18 +1187,27 @@ checkDataDir(void)
SEP_CHAR
);
SEP_CHAR
);
if
((
fp
=
fopen
(
path
,
"r"
))
==
NULL
)
{
if
((
fp
=
fopen
(
path
,
"r"
))
==
NULL
)
{
fprintf
(
stderr
,
"%s does not find the database. Expected to find it "
fprintf
(
stderr
,
"%s does not find the database. Expected to find it "
"in the PGDATA directory
\"
%s
\"
, but unable to open
directory
"
"in the PGDATA directory
\"
%s
\"
, but unable to open
file
"
"with pathname
\"
%s
\"
.
\n
"
,
"with pathname
\"
%s
\"
.
\n
"
,
progname
,
DataDir
,
path
);
progname
,
DataDir
,
path
);
exit
(
2
);
exit
(
2
);
}
}
fclose
(
fp
);
fclose
(
fp
);
#ifndef WIN32
#ifndef WIN32
if
(
!
ValidPgVersion
(
DataDir
))
{
{
fprintf
(
stderr
,
"%s: data base in
\"
%s
\"
is of a different version.
\n
"
,
char
*
reason
;
/* reason ValidatePgVersion failed. NULL if didn't */
progname
,
DataDir
);
ValidatePgVersion
(
DataDir
,
&
reason
);
exit
(
2
);
if
(
reason
)
{
fprintf
(
stderr
,
"Database system in directory %s "
"is not compatible with this version of "
"Postgres, or we are unable to read the PG_VERSION file. "
"Explanation from ValidatePgVersion: %s
\n
"
,
DataDir
,
reason
);
free
(
reason
);
exit
(
2
);
}
}
}
#endif
/* WIN32 */
#endif
/* WIN32 */
}
}
...
...
src/backend/utils/init/Makefile
View file @
17befd6c
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
# Makefile for utils/init
# Makefile for utils/init
#
#
# IDENTIFICATION
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/utils/init/Makefile,v 1.
2 1996/11/09 06:23:41 momjian
Exp $
# $Header: /cvsroot/pgsql/src/backend/utils/init/Makefile,v 1.
3 1996/11/12 06:46:40 bryanh
Exp $
#
#
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
...
@@ -20,7 +20,7 @@ CFLAGS += $(INCLUDE_OPT)
...
@@ -20,7 +20,7 @@ CFLAGS += $(INCLUDE_OPT)
CFLAGS
+=
-DPOSTGRESDIR
=
'"
$(POSTGRESDIR)
"'
-DPGDATADIR
=
'"
$(DATADIR)
"'
\
CFLAGS
+=
-DPOSTGRESDIR
=
'"
$(POSTGRESDIR)
"'
-DPGDATADIR
=
'"
$(DATADIR)
"'
\
-DPOSTPORT
=
'"
$(POSTPORT)
"'
-DPOSTPORT
=
'"
$(POSTPORT)
"'
OBJS
=
enbl.o findbe.o globals.o m
agic.o m
iscinit.o postinit.o
OBJS
=
enbl.o findbe.o globals.o miscinit.o postinit.o
all
:
SUBSYS.o
all
:
SUBSYS.o
...
...
src/backend/utils/init/postinit.c
View file @
17befd6c
This diff is collapsed.
Click to expand it.
src/bin/pg_version/Makefile
View file @
17befd6c
...
@@ -7,20 +7,34 @@
...
@@ -7,20 +7,34 @@
#
#
#
#
# IDENTIFICATION
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/pg_version/Attic/Makefile,v 1.
1.1.1 1996/07/09 06:22:14 scrappy
Exp $
# $Header: /cvsroot/pgsql/src/bin/pg_version/Attic/Makefile,v 1.
2 1996/11/12 06:46:54 bryanh
Exp $
#
#
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
PROG
=
pg_version
SRCDIR
=
../..
MKDIR
=
../../mk
include
$(MKDIR)/postgres.mk
include
../Makefile.global
include
../Makefile.global
include
../../Makefile.global
OBJS
=
pg_version.o ../../utils/version.o
all
:
pg_version
pg_version
:
submake $(OBJS)
$(CC)
$(LDFLAGS)
-o
pg_version
$(OBJS)
$(LD_ADD)
.PHONY
:
submake
submake
:
$(MAKE)
-C
../../utils version.o
VPATH
:=
$(VPATH)
:
$(srcdir)
/backend/utils/init
install
:
pg_version
SRCS
=
pg_version.c magic.c
$(INSTALL)
$(INSTL_EXE_OPTS)
pg_version
$(DESTDIR)$(BINDIR)
/pg_version
CFLAGS
+=
-I
$(srcdir)
/backend/port/
$(PORTNAME)
depend dep
:
$(CC)
-MM
$(INCLUDE_OPT)
*
.c
>
depend
include
$(MKDIR)/postgres.prog.mk
clean
:
rm
-f
pg_version pg_version.o
ifeq
(depend,$(wildcard depend))
include
depend
endif
src/bin/pg_version/pg_version.c
View file @
17befd6c
...
@@ -7,38 +7,34 @@
...
@@ -7,38 +7,34 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_version/Attic/pg_version.c,v 1.
5 1996/11/10 03:04:02 momjian
Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_version/Attic/pg_version.c,v 1.
6 1996/11/12 06:47:00 bryanh
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
#include <stdlib.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
int
Noversion
=
0
;
#include <version.h>
/* interface to SetPgVersion */
char
*
DataDir
=
(
char
*
)
NULL
;
extern
void
SetPgVersion
(
const
char
*
);
int
int
main
(
int
argc
,
char
**
argv
)
main
(
int
argc
,
char
**
argv
)
{
{
int
retcode
;
/* our eventual return code */
char
*
reason
;
/* Reason that SetPgVersion failed, NULL if it didn't. */
if
(
argc
<
2
)
{
if
(
argc
<
2
)
{
fprintf
(
stderr
,
"pg_version: missing argument
\n
"
);
fprintf
(
stderr
,
"pg_version: missing argument
\n
"
);
exit
(
1
);
exit
(
1
);
}
}
SetPgVersion
(
argv
[
1
]);
SetPgVersion
(
argv
[
1
],
&
reason
);
return
(
0
);
if
(
reason
)
{
}
fprintf
(
stderr
,
"pg_version is unable to create the PG_VERSION file. "
void
elog
(
void
);
/* make compiler happy */
"SetPgVersion gave this reason: %s
\n
"
,
reason
);
void
retcode
=
10
;
elog
(
void
)
{}
}
else
retcode
=
0
;
return
(
retcode
);
int
GetDataHome
(
void
);
/* make compiler happy */
int
GetDataHome
(
void
)
{
return
(
0
);
}
}
src/include/miscadmin.h
View file @
17befd6c
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,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 1996/11/06 10:28:59 scrappy
Exp $
* $Id: miscadmin.h,v 1.
3 1996/11/12 06:47:10 bryanh
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
...
@@ -69,14 +69,6 @@ extern Oid LastOidProcessed; /* for query rewrite */
...
@@ -69,14 +69,6 @@ extern Oid LastOidProcessed; /* for query rewrite */
*/
*/
#define NDBUFS 64
#define NDBUFS 64
/*****************************************************************************
* magic.h - definitions of the indexes of the magic numbers *
*****************************************************************************/
#define PG_RELEASE 6
#define PG_VERSION 0
#define PG_VERFILE "PG_VERSION"
/*****************************************************************************
/*****************************************************************************
* pdir.h -- *
* pdir.h -- *
* POSTGRES directory path definitions. *
* POSTGRES directory path definitions. *
...
@@ -148,7 +140,6 @@ typedef int16 ExitStatus;
...
@@ -148,7 +140,6 @@ typedef int16 ExitStatus;
/* in utils/init/postinit.c */
/* in utils/init/postinit.c */
extern
void
InitMyDatabaseId
(
void
);
extern
void
InitMyDatabaseId
(
void
);
extern
void
DoChdirAndInitDatabaseNameAndPath
(
char
*
name
,
char
*
path
);
extern
void
InitUserid
(
void
);
extern
void
InitUserid
(
void
);
extern
void
InitCommunication
(
void
);
extern
void
InitCommunication
(
void
);
extern
void
InitStdio
(
void
);
extern
void
InitStdio
(
void
);
...
@@ -170,12 +161,4 @@ extern bool IsNormalProcessingMode(void);
...
@@ -170,12 +161,4 @@ extern bool IsNormalProcessingMode(void);
extern
void
SetProcessingMode
(
ProcessingMode
mode
);
extern
void
SetProcessingMode
(
ProcessingMode
mode
);
extern
ProcessingMode
GetProcessingMode
(
void
);
extern
ProcessingMode
GetProcessingMode
(
void
);
/*
* Prototypes for utils/init/magic.c
*/
extern
int
DatabaseMetaGunkIsConsistent
(
const
char
*
database
,
char
*
path
);
extern
int
ValidPgVersion
(
const
char
*
path
);
extern
void
SetPgVersion
(
const
char
*
path
);
#endif
/* MISCADMIN_H */
#endif
/* MISCADMIN_H */
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