aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands')
-rw-r--r--src/backend/commands/dbcommands.c20
-rw-r--r--src/backend/commands/tablespace.c35
-rw-r--r--src/backend/commands/vacuum.c10
-rw-r--r--src/backend/commands/variable.c10
4 files changed, 42 insertions, 33 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index aa95d97d0e2..38696cf7070 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.142 2004/08/29 21:08:47 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.143 2004/08/30 02:54:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1117,24 +1117,27 @@ dbase_redo(XLogRecPtr lsn, XLogRecord *record)
xl_dbase_create_rec *xlrec = (xl_dbase_create_rec *) XLogRecGetData(record);
char *dst_path = xlrec->src_path + strlen(xlrec->src_path) + 1;
struct stat st;
+
#ifndef WIN32
char buf[2 * MAXPGPATH + 100];
#endif
/*
- * Our theory for replaying a CREATE is to forcibly drop the target
- * subdirectory if present, then re-copy the source data. This
- * may be more work than needed, but it is simple to implement.
+ * Our theory for replaying a CREATE is to forcibly drop the
+ * target subdirectory if present, then re-copy the source data.
+ * This may be more work than needed, but it is simple to
+ * implement.
*/
if (stat(dst_path, &st) == 0 && S_ISDIR(st.st_mode))
{
if (!rmtree(dst_path, true))
ereport(WARNING,
- (errmsg("could not remove database directory \"%s\"",
- dst_path)));
+ (errmsg("could not remove database directory \"%s\"",
+ dst_path)));
}
#ifndef WIN32
+
/*
* Copy this subdirectory to the new location
*
@@ -1164,7 +1167,10 @@ dbase_redo(XLogRecPtr lsn, XLogRecord *record)
{
xl_dbase_drop_rec *xlrec = (xl_dbase_drop_rec *) XLogRecGetData(record);
- /* Drop pages for this database that are in the shared buffer cache */
+ /*
+ * Drop pages for this database that are in the shared buffer
+ * cache
+ */
DropBuffers(xlrec->db_id);
if (!rmtree(xlrec->dir_path, true))
diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c
index 3b44ebb19f4..b9fbd2b5eab 100644
--- a/src/backend/commands/tablespace.c
+++ b/src/backend/commands/tablespace.c
@@ -45,7 +45,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.10 2004/08/29 21:08:47 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.11 2004/08/30 02:54:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -146,27 +146,27 @@ TablespaceCreateDbspace(Oid spcNode, Oid dbNode, bool isRedo)
/* OK, go for it */
if (mkdir(dir, S_IRWXU) < 0)
{
- char *parentdir;
+ char *parentdir;
if (errno != ENOENT || !isRedo)
ereport(ERROR,
(errcode_for_file_access(),
- errmsg("could not create directory \"%s\": %m",
- dir)));
+ errmsg("could not create directory \"%s\": %m",
+ dir)));
/* Try to make parent directory too */
parentdir = pstrdup(dir);
get_parent_directory(parentdir);
if (mkdir(parentdir, S_IRWXU) < 0)
ereport(ERROR,
(errcode_for_file_access(),
- errmsg("could not create directory \"%s\": %m",
- parentdir)));
+ errmsg("could not create directory \"%s\": %m",
+ parentdir)));
pfree(parentdir);
if (mkdir(dir, S_IRWXU) < 0)
ereport(ERROR,
(errcode_for_file_access(),
- errmsg("could not create directory \"%s\": %m",
- dir)));
+ errmsg("could not create directory \"%s\": %m",
+ dir)));
}
}
@@ -444,7 +444,8 @@ DropTableSpace(DropTableSpaceStmt *stmt)
tablespacename);
/*
- * Remove the pg_tablespace tuple (this will roll back if we fail below)
+ * Remove the pg_tablespace tuple (this will roll back if we fail
+ * below)
*/
simple_heap_delete(rel, &tuple->t_self);
@@ -598,8 +599,8 @@ remove_tablespace_directories(Oid tablespaceoid, bool redo)
/*
* Okay, try to remove the symlink. We must however deal with the
* possibility that it's a directory instead of a symlink --- this
- * could happen during WAL replay (see TablespaceCreateDbspace),
- * and it is also the normal case on Windows.
+ * could happen during WAL replay (see TablespaceCreateDbspace), and
+ * it is also the normal case on Windows.
*/
if (lstat(location, &st) == 0 && S_ISDIR(st.st_mode))
{
@@ -959,14 +960,14 @@ tblspc_redo(XLogRecPtr lsn, XLogRecord *record)
char *linkloc;
/*
- * Attempt to coerce target directory to safe permissions. If this
- * fails, it doesn't exist or has the wrong owner.
+ * Attempt to coerce target directory to safe permissions. If
+ * this fails, it doesn't exist or has the wrong owner.
*/
if (chmod(location, 0700) != 0)
ereport(ERROR,
(errcode_for_file_access(),
- errmsg("could not set permissions on directory \"%s\": %m",
- location)));
+ errmsg("could not set permissions on directory \"%s\": %m",
+ location)));
/* Create or re-create the PG_VERSION file in the target directory */
set_short_version(location);
@@ -980,8 +981,8 @@ tblspc_redo(XLogRecPtr lsn, XLogRecord *record)
if (errno != EEXIST)
ereport(ERROR,
(errcode_for_file_access(),
- errmsg("could not create symbolic link \"%s\": %m",
- linkloc)));
+ errmsg("could not create symbolic link \"%s\": %m",
+ linkloc)));
}
pfree(linkloc);
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index 67c1c02b6d2..8ace2777d43 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.289 2004/08/29 05:06:41 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.290 2004/08/30 02:54:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1704,10 +1704,10 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
if (!(tuple.t_data->t_infomask & HEAP_XMIN_COMMITTED))
{
/*
- * There cannot be another concurrently running VACUUM.
- * If the tuple had been moved in by a previous VACUUM,
- * the visibility check would have set XMIN_COMMITTED. If
- * the tuple had been moved in by the currently running
+ * There cannot be another concurrently running VACUUM. If
+ * the tuple had been moved in by a previous VACUUM, the
+ * visibility check would have set XMIN_COMMITTED. If the
+ * tuple had been moved in by the currently running
* VACUUM, the loop would have been terminated. We had
* elog(ERROR, ...) here, but as we are testing for a
* can't-happen condition, Assert() seems more
diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c
index cb4a3cde717..f262754a56e 100644
--- a/src/backend/commands/variable.c
+++ b/src/backend/commands/variable.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.101 2004/08/29 05:06:41 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/variable.c,v 1.102 2004/08/30 02:54:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -270,6 +270,7 @@ assign_timezone(const char *value, bool doit, GucSource source)
CStringGetDatum(val),
ObjectIdGetDatum(InvalidOid),
Int32GetDatum(-1)));
+
pfree(val);
if (interval->month != 0)
{
@@ -284,6 +285,7 @@ assign_timezone(const char *value, bool doit, GucSource source)
{
/* Here we change from SQL to Unix sign convention */
CTimeZone = -interval->time;
+
HasCTZSet = true;
}
pfree(interval);
@@ -448,10 +450,10 @@ show_timezone(void)
if (HasCTZSet)
{
- Interval interval;
+ Interval interval;
- interval.month = 0;
- interval.time = -CTimeZone;
+ interval. month = 0;
+ interval. time = -CTimeZone;
tzn = DatumGetCString(DirectFunctionCall1(interval_out,
IntervalPGetDatum(&interval)));