aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>1999-10-25 03:08:03 +0000
committerTom Lane <tgl@sss.pgh.pa.us>1999-10-25 03:08:03 +0000
commit51f62d505e2aba66bf7870c7bd005cd32e7d0953 (patch)
tree127e7cbbf6679dbc2e3cfd08786ab88a7a801f50 /src/backend/tcop/postgres.c
parent8a17ed63359325c567694fdd378e71803a53cc73 (diff)
downloadpostgresql-51f62d505e2aba66bf7870c7bd005cd32e7d0953.tar.gz
postgresql-51f62d505e2aba66bf7870c7bd005cd32e7d0953.zip
Standardize on MAXPGPATH as the size of a file pathname buffer,
eliminating some wildly inconsistent coding in various parts of the system. I set MAXPGPATH = 1024 in config.h.in. If anyone is really convinced that there ought to be a configure-time test to set the value, go right ahead ... but I think it's a waste of time.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index ddf6c280e4f..a73344e932a 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.135 1999/10/23 03:13:22 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.136 1999/10/25 03:07:48 tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -92,7 +92,6 @@
* ----------------
*/
-/*static bool EnableRewrite = true; , never changes why have it*/
CommandDest whereToSendOutput = Debug;
/* Define status buffer needed by PS_SET_STATUS */
@@ -114,8 +113,6 @@ int dontExecute = 0;
static int ShowStats;
static bool IsEmptyQuery = false;
-char relname[80]; /* current relation name */
-
/* note: these declarations had better match tcopprot.h */
DLLIMPORT sigjmp_buf Warn_restart;
@@ -126,7 +123,7 @@ extern int NBuffers;
static bool EchoQuery = false; /* default don't echo */
time_t tim;
-char pg_pathname[256];
+char pg_pathname[MAXPGPATH];
FILE *StatFp;
/* ----------------
@@ -1359,8 +1356,10 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
proc_exit(1);
}
BaseInit();
- sprintf(XLogDir, "%s%cpg_xlog", DataDir, SEP_CHAR);
- sprintf(ControlFilePath, "%s%cpg_control", DataDir, SEP_CHAR);
+ snprintf(XLogDir, MAXPGPATH, "%s%cpg_xlog",
+ DataDir, SEP_CHAR);
+ snprintf(ControlFilePath, MAXPGPATH, "%s%cpg_control",
+ DataDir, SEP_CHAR);
StartupXLOG();
}
@@ -1372,6 +1371,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
SetCharSet();
#endif
+ /* On some systems our dynloader code needs the executable's pathname */
if (FindExec(pg_pathname, argv[0], "postgres") < 0)
elog(FATAL, "%s: could not locate executable, bailing out...",
argv[0]);
@@ -1494,7 +1494,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
if (!IsUnderPostmaster)
{
puts("\nPOSTGRES backend interactive interface ");
- puts("$Revision: 1.135 $ $Date: 1999/10/23 03:13:22 $\n");
+ puts("$Revision: 1.136 $ $Date: 1999/10/25 03:07:48 $\n");
}
/*