pgindent run for 9.0, second run

REL9_0_STABLE
Bruce Momjian 15 years ago
parent 52783b212c
commit 239d769e7e
  1. 6
      contrib/dblink/dblink.c
  2. 2
      contrib/fuzzystrmatch/dmetaphone.c
  3. 52
      contrib/pg_archivecleanup/pg_archivecleanup.c
  4. 3
      contrib/pg_upgrade/check.c
  5. 3
      contrib/pg_upgrade/controldata.c
  6. 2
      contrib/pg_upgrade/dump.c
  7. 4
      contrib/pg_upgrade/exec.c
  8. 9
      contrib/pg_upgrade/file.c
  9. 2
      contrib/pg_upgrade/info.c
  10. 2
      contrib/pg_upgrade/option.c
  11. 19
      contrib/pg_upgrade/pg_upgrade.c
  12. 12
      contrib/pg_upgrade/pg_upgrade.h
  13. 2
      contrib/pg_upgrade/relfilenode.c
  14. 10
      contrib/pg_upgrade/server.c
  15. 2
      contrib/pg_upgrade/tablespace.c
  16. 2
      contrib/pg_upgrade/util.c
  17. 3
      contrib/pg_upgrade_support/pg_upgrade_support.c
  18. 6
      contrib/pgbench/pgbench.c
  19. 2
      contrib/pgcrypto/sha2.c
  20. 6
      contrib/xml2/xpath.c
  21. 6
      contrib/xml2/xslt_proc.c
  22. 8
      src/backend/access/heap/heapam.c
  23. 5
      src/backend/access/heap/pruneheap.c
  24. 6
      src/backend/access/nbtree/nbtpage.c
  25. 49
      src/backend/access/nbtree/nbtxlog.c
  26. 2
      src/backend/access/transam/twophase.c
  27. 20
      src/backend/access/transam/xact.c
  28. 217
      src/backend/access/transam/xlog.c
  29. 6
      src/backend/catalog/aclchk.c
  30. 2
      src/backend/catalog/pg_proc.c
  31. 6
      src/backend/catalog/pg_shdepend.c
  32. 12
      src/backend/commands/indexcmds.c
  33. 2
      src/backend/commands/opclasscmds.c
  34. 8
      src/backend/commands/operatorcmds.c
  35. 6
      src/backend/commands/tablecmds.c
  36. 2
      src/backend/commands/tablespace.c
  37. 11
      src/backend/commands/vacuumlazy.c
  38. 6
      src/backend/executor/execUtils.c
  39. 8
      src/backend/executor/functions.c
  40. 17
      src/backend/executor/nodeMergejoin.c
  41. 6
      src/backend/lib/stringinfo.c
  42. 16
      src/backend/libpq/auth.c
  43. 3
      src/backend/libpq/be-secure.c
  44. 7
      src/backend/libpq/hba.c
  45. 17
      src/backend/optimizer/path/costsize.c
  46. 14
      src/backend/optimizer/plan/analyzejoins.c
  47. 6
      src/backend/optimizer/plan/planagg.c
  48. 2
      src/backend/optimizer/plan/planmain.c
  49. 2
      src/backend/optimizer/prep/prepjointree.c
  50. 6
      src/backend/optimizer/prep/prepunion.c
  51. 2
      src/backend/optimizer/util/placeholder.c
  52. 31
      src/backend/parser/parse_expr.c
  53. 2
      src/backend/parser/scansup.c
  54. 22
      src/backend/port/sysv_shmem.c
  55. 2
      src/backend/port/win32/socket.c
  56. 2
      src/backend/port/win32/timer.c
  57. 10
      src/backend/postmaster/pgstat.c
  58. 7
      src/backend/postmaster/postmaster.c
  59. 8
      src/backend/postmaster/syslogger.c
  60. 34
      src/backend/replication/libpqwalreceiver/libpqwalreceiver.c
  61. 3
      src/backend/replication/walreceiver.c
  62. 2
      src/backend/replication/walreceiverfuncs.c
  63. 57
      src/backend/replication/walsender.c
  64. 12
      src/backend/storage/file/copydir.c
  65. 16
      src/backend/storage/ipc/ipc.c
  66. 212
      src/backend/storage/ipc/procarray.c
  67. 2
      src/backend/storage/ipc/shmem.c
  68. 24
      src/backend/storage/ipc/standby.c
  69. 13
      src/backend/storage/lmgr/proc.c
  70. 2
      src/backend/tcop/fastpath.c
  71. 6
      src/backend/tcop/postgres.c
  72. 16
      src/backend/tsearch/ts_typanalyze.c
  73. 13
      src/backend/utils/adt/formatting.c
  74. 10
      src/backend/utils/adt/like_match.c
  75. 8
      src/backend/utils/adt/oid.c
  76. 41
      src/backend/utils/adt/pg_locale.c
  77. 6
      src/backend/utils/adt/xml.c
  78. 5
      src/backend/utils/cache/catcache.c
  79. 16
      src/backend/utils/cache/relcache.c
  80. 27
      src/backend/utils/init/postinit.c
  81. 2
      src/backend/utils/mb/mbutils.c
  82. 40
      src/backend/utils/misc/guc.c
  83. 2
      src/backend/utils/misc/ps_status.c
  84. 8
      src/backend/utils/mmgr/portalmem.c
  85. 10
      src/bin/pg_dump/pg_backup_archiver.c
  86. 14
      src/bin/pg_dump/pg_backup_custom.c
  87. 6
      src/bin/pg_dump/pg_dump.c
  88. 2
      src/bin/psql/command.c
  89. 18
      src/bin/psql/common.c
  90. 2
      src/bin/psql/describe.c
  91. 3
      src/bin/psql/print.c
  92. 2
      src/bin/psql/print.h
  93. 2
      src/bin/psql/tab-complete.c
  94. 5
      src/include/access/nbtree.h
  95. 2
      src/include/nodes/relation.h
  96. 3
      src/include/port/win32.h
  97. 2
      src/include/replication/walprotocol.h
  98. 11
      src/include/replication/walreceiver.h
  99. 2
      src/include/storage/pmsignal.h
  100. 2
      src/include/storage/proc.h
  101. Some files were not shown because too many files have changed in this diff Show More

@ -8,7 +8,7 @@
* Darko Prenosil <Darko.Prenosil@finteh.hr>
* Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
*
* $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.98 2010/06/15 20:29:01 tgl Exp $
* $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.99 2010/07/06 19:18:54 momjian Exp $
* Copyright (c) 2001-2010, PostgreSQL Global Development Group
* ALL RIGHTS RESERVED;
*
@ -1976,8 +1976,8 @@ get_tuple_of_interest(Relation rel, int *pkattnums, int pknumatts, char **src_pk
* Build sql statement to look up tuple of interest, ie, the one matching
* src_pkattvals. We used to use "SELECT *" here, but it's simpler to
* generate a result tuple that matches the table's physical structure,
* with NULLs for any dropped columns. Otherwise we have to deal with
* two different tupdescs and everything's very confusing.
* with NULLs for any dropped columns. Otherwise we have to deal with two
* different tupdescs and everything's very confusing.
*/
appendStringInfoString(&buf, "SELECT ");

@ -1,7 +1,7 @@
/*
* This is a port of the Double Metaphone algorithm for use in PostgreSQL.
*
* $PostgreSQL: pgsql/contrib/fuzzystrmatch/dmetaphone.c,v 1.14 2010/04/05 02:46:20 adunstan Exp $
* $PostgreSQL: pgsql/contrib/fuzzystrmatch/dmetaphone.c,v 1.15 2010/07/06 19:18:55 momjian Exp $
*
* Double Metaphone computes 2 "sounds like" strings - a primary and an
* alternate. In most cases they are the same, but for foreign names

@ -1,5 +1,5 @@
/*
* $PostgreSQL: pgsql/contrib/pg_archivecleanup/pg_archivecleanup.c,v 1.2 2010/06/17 17:31:27 tgl Exp $
* $PostgreSQL: pgsql/contrib/pg_archivecleanup/pg_archivecleanup.c,v 1.3 2010/07/06 19:18:55 momjian Exp $
*
* pg_archivecleanup.c
*
@ -40,8 +40,9 @@ bool debug = false; /* are we debugging? */
char *archiveLocation; /* where to find the archive? */
char *restartWALFileName; /* the file from which we can restart restore */
char WALFilePath[MAXPGPATH]; /* the file path including archive */
char exclusiveCleanupFileName[MAXPGPATH]; /* the oldest file we want to
* remain in archive */
char exclusiveCleanupFileName[MAXPGPATH]; /* the oldest file we
* want to remain in
* archive */
/* =====================================================================
@ -74,8 +75,8 @@ static void
Initialize(void)
{
/*
* This code assumes that archiveLocation is a directory, so we use
* stat to test if it's accessible.
* This code assumes that archiveLocation is a directory, so we use stat
* to test if it's accessible.
*/
struct stat stat_buf;
@ -100,18 +101,17 @@ CleanupPriorWALFiles(void)
while ((xlde = readdir(xldir)) != NULL)
{
/*
* We ignore the timeline part of the XLOG segment identifiers
* in deciding whether a segment is still needed. This
* ensures that we won't prematurely remove a segment from a
* parent timeline. We could probably be a little more
* proactive about removing segments of non-parent timelines,
* but that would be a whole lot more complicated.
* We ignore the timeline part of the XLOG segment identifiers in
* deciding whether a segment is still needed. This ensures that
* we won't prematurely remove a segment from a parent timeline.
* We could probably be a little more proactive about removing
* segments of non-parent timelines, but that would be a whole lot
* more complicated.
*
* We use the alphanumeric sorting property of the filenames
* to decide which ones are earlier than the
* exclusiveCleanupFileName file. Note that this means files
* are not removed in the order they were originally written,
* in case this worries you.
* We use the alphanumeric sorting property of the filenames to
* decide which ones are earlier than the exclusiveCleanupFileName
* file. Note that this means files are not removed in the order
* they were originally written, in case this worries you.
*/
if (strlen(xlde->d_name) == XLOG_DATA_FNAME_LEN &&
strspn(xlde->d_name, "0123456789ABCDEF") == XLOG_DATA_FNAME_LEN &&
@ -155,10 +155,10 @@ SetWALFileNameForCleanup(void)
bool fnameOK = false;
/*
* If restartWALFileName is a WAL file name then just use it directly.
* If restartWALFileName is a .backup filename, make sure we use
* the prefix of the filename, otherwise we will remove wrong files
* since 000000010000000000000010.00000020.backup is after
* If restartWALFileName is a WAL file name then just use it directly. If
* restartWALFileName is a .backup filename, make sure we use the prefix
* of the filename, otherwise we will remove wrong files since
* 000000010000000000000010.00000020.backup is after
* 000000010000000000000010.
*/
if (strlen(restartWALFileName) == XLOG_DATA_FNAME_LEN &&
@ -174,12 +174,15 @@ SetWALFileNameForCleanup(void)
log = 0,
seg = 0,
offset = 0;
args = sscanf(restartWALFileName, "%08X%08X%08X.%08X.backup", &tli, &log, &seg, &offset);
if (args == 4)
{
fnameOK = true;
/*
* Use just the prefix of the filename, ignore everything after first period
* Use just the prefix of the filename, ignore everything after
* first period
*/
XLogFileName(exclusiveCleanupFileName, tli, log, seg);
}
@ -258,9 +261,10 @@ main(int argc, char **argv)
/*
* We will go to the archiveLocation to check restartWALFileName.
* restartWALFileName may not exist anymore, which would not be an error, so
* we separate the archiveLocation and restartWALFileName so we can check
* separately whether archiveLocation exists, if not that is an error
* restartWALFileName may not exist anymore, which would not be an error,
* so we separate the archiveLocation and restartWALFileName so we can
* check separately whether archiveLocation exists, if not that is an
* error
*/
if (optind < argc)
{

@ -4,7 +4,7 @@
* server checks and output routines
*
* Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade/check.c,v 1.10 2010/07/03 16:33:14 momjian Exp $
* $PostgreSQL: pgsql/contrib/pg_upgrade/check.c,v 1.11 2010/07/06 19:18:55 momjian Exp $
*/
#include "pg_upgrade.h"
@ -420,6 +420,7 @@ create_script_for_old_cluster_deletion(migratorContext *ctx,
}
}
else
/*
* Simply delete the tablespace directory, which might be ".old"
* or a version-specific subdirectory.

@ -4,7 +4,7 @@
* controldata functions
*
* Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade/controldata.c,v 1.8 2010/07/03 16:33:14 momjian Exp $
* $PostgreSQL: pgsql/contrib/pg_upgrade/controldata.c,v 1.9 2010/07/06 19:18:55 momjian Exp $
*/
#include "pg_upgrade.h"
@ -93,6 +93,7 @@ get_control_data(migratorContext *ctx, ClusterInfo *cluster, bool live_check)
fputs(bufin, ctx->debug_fd);
#ifdef WIN32
/*
* Due to an installer bug, LANG=C doesn't work for PG 8.3.3, but does
* work 8.2.6 and 8.3.7, so check for non-ASCII output and suggest a

@ -4,7 +4,7 @@
* dump functions
*
* Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade/dump.c,v 1.6 2010/07/03 16:33:14 momjian Exp $
* $PostgreSQL: pgsql/contrib/pg_upgrade/dump.c,v 1.7 2010/07/06 19:18:55 momjian Exp $
*/
#include "pg_upgrade.h"

@ -4,7 +4,7 @@
* execution functions
*
* Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade/exec.c,v 1.7 2010/07/03 16:33:14 momjian Exp $
* $PostgreSQL: pgsql/contrib/pg_upgrade/exec.c,v 1.8 2010/07/06 19:18:55 momjian Exp $
*/
#include "pg_upgrade.h"
@ -311,5 +311,3 @@ check_data_dir(migratorContext *ctx, const char *pg_data)
return (fail) ? -1 : 0;
}

@ -4,7 +4,7 @@
* file system operations
*
* Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade/file.c,v 1.12 2010/07/03 16:33:14 momjian Exp $
* $PostgreSQL: pgsql/contrib/pg_upgrade/file.c,v 1.13 2010/07/06 19:18:55 momjian Exp $
*/
#include "pg_upgrade.h"
@ -235,13 +235,14 @@ pg_scandir(migratorContext *ctx, const char *dirname,
/*
* scandir() is originally from BSD 4.3, which had the third argument as
* non-const. Linux and other C libraries have updated it to use a const.
* http://unix.derkeiler.com/Mailing-Lists/FreeBSD/questions/2005-12/msg00214.html
* http://unix.derkeiler.com/Mailing-Lists/FreeBSD/questions/2005-12/msg002
* 14.html
*
* Here we try to guess which libc's need const, and which don't. The net
* goal here is to try to suppress a compiler warning due to a prototype
* mismatch of const usage. Ideally we would do this via autoconf, but
* autoconf doesn't have a suitable builtin test and it seems overkill
* to add one just to avoid a warning.
* autoconf doesn't have a suitable builtin test and it seems overkill to
* add one just to avoid a warning.
*/
#elif defined(__FreeBSD__) || defined(__bsdi__) || defined(__darwin__) || defined(__OpenBSD__)
/* no const */

@ -4,7 +4,7 @@
* information support functions
*
* Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade/info.c,v 1.10 2010/07/03 16:33:14 momjian Exp $
* $PostgreSQL: pgsql/contrib/pg_upgrade/info.c,v 1.11 2010/07/06 19:18:55 momjian Exp $
*/
#include "pg_upgrade.h"

@ -4,7 +4,7 @@
* options functions
*
* Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade/option.c,v 1.11 2010/07/03 16:33:14 momjian Exp $
* $PostgreSQL: pgsql/contrib/pg_upgrade/option.c,v 1.12 2010/07/06 19:18:55 momjian Exp $
*/
#include "pg_upgrade.h"

@ -4,7 +4,7 @@
* main source file
*
* Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade/pg_upgrade.c,v 1.9 2010/07/03 16:33:14 momjian Exp $
* $PostgreSQL: pgsql/contrib/pg_upgrade/pg_upgrade.c,v 1.10 2010/07/06 19:18:55 momjian Exp $
*/
#include "pg_upgrade.h"
@ -166,10 +166,10 @@ prepare_new_cluster(migratorContext *ctx)
check_ok(ctx);
/*
* We do freeze after analyze so pg_statistic is also frozen.
* template0 is not frozen here, but data rows were frozen by initdb,
* and we set its datfrozenxid and relfrozenxids later to match the
* new xid counter later.
* We do freeze after analyze so pg_statistic is also frozen. template0 is
* not frozen here, but data rows were frozen by initdb, and we set its
* datfrozenxid and relfrozenxids later to match the new xid counter
* later.
*/
prep_status(ctx, "Freezing all rows on the new cluster");
exec_prog(ctx, true,
@ -300,7 +300,8 @@ void
set_frozenxids(migratorContext *ctx)
{
int dbnum;
PGconn *conn, *conn_template1;
PGconn *conn,
*conn_template1;
PGresult *dbres;
int ntups;
int i_datname;
@ -333,9 +334,9 @@ set_frozenxids(migratorContext *ctx)
/*
* We must update databases where datallowconn = false, e.g.
* template0, because autovacuum increments their datfrozenxids and
* relfrozenxids even if autovacuum is turned off, and even though
* all the data rows are already frozen To enable this, we
* temporarily change datallowconn.
* relfrozenxids even if autovacuum is turned off, and even though all
* the data rows are already frozen To enable this, we temporarily
* change datallowconn.
*/
if (strcmp(datallowconn, "f") == 0)
PQclear(executeQueryOrDie(ctx, conn_template1,

@ -2,7 +2,7 @@
* pg_upgrade.h
*
* Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade/pg_upgrade.h,v 1.14 2010/07/03 16:33:14 momjian Exp $
* $PostgreSQL: pgsql/contrib/pg_upgrade/pg_upgrade.h,v 1.15 2010/07/06 19:18:55 momjian Exp $
*/
#include "postgres.h"
@ -197,7 +197,8 @@ typedef struct
*/
typedef struct
{
ClusterInfo old, new; /* old and new cluster information */
ClusterInfo old,
new; /* old and new cluster information */
const char *progname; /* complete pathname for this program */
char *exec_path; /* full path to my executable */
char *user; /* username for clusters */
@ -279,10 +280,8 @@ typedef const char *(*pluginShutdown) (void *pluginData);
typedef struct
{
uint16 oldPageVersion; /* Page layout version of the old
* cluster */
uint16 newPageVersion; /* Page layout version of the new
* cluster */
uint16 oldPageVersion; /* Page layout version of the old cluster */
uint16 newPageVersion; /* Page layout version of the new cluster */
uint16 pluginVersion; /* API version of converter plugin */
void *pluginData; /* Plugin data (set by plugin) */
pluginStartup startup; /* Pointer to plugin's startup function */
@ -294,7 +293,6 @@ typedef struct
} pageCnvCtx;
const char *setupPageConverter(migratorContext *ctx, pageCnvCtx **result);
#else
/* dummy */
typedef void *pageCnvCtx;

@ -4,7 +4,7 @@
* relfilenode functions
*
* Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade/relfilenode.c,v 1.7 2010/07/03 16:33:14 momjian Exp $
* $PostgreSQL: pgsql/contrib/pg_upgrade/relfilenode.c,v 1.8 2010/07/06 19:18:55 momjian Exp $
*/
#include "pg_upgrade.h"

@ -4,7 +4,7 @@
* database server functions
*
* Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade/server.c,v 1.7 2010/07/03 16:33:14 momjian Exp $
* $PostgreSQL: pgsql/contrib/pg_upgrade/server.c,v 1.8 2010/07/06 19:18:55 momjian Exp $
*/
#include "pg_upgrade.h"
@ -181,10 +181,10 @@ start_postmaster(migratorContext *ctx, Cluster whichCluster, bool quiet)
}
/*
* On Win32, we can't send both server output and pg_ctl output
* to the same file because we get the error:
* "The process cannot access the file because it is being used by another process."
* so we have to send pg_ctl output to 'nul'.
* On Win32, we can't send both server output and pg_ctl output to the
* same file because we get the error: "The process cannot access the file
* because it is being used by another process." so we have to send pg_ctl
* output to 'nul'.
*/
snprintf(cmd, sizeof(cmd),
SYSTEMQUOTE "\"%s/pg_ctl\" -l \"%s\" -D \"%s\" "

@ -4,7 +4,7 @@
* tablespace functions
*
* Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade/tablespace.c,v 1.5 2010/07/03 16:33:14 momjian Exp $
* $PostgreSQL: pgsql/contrib/pg_upgrade/tablespace.c,v 1.6 2010/07/06 19:18:55 momjian Exp $
*/
#include "pg_upgrade.h"

@ -4,7 +4,7 @@
* utility functions
*
* Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade/util.c,v 1.4 2010/07/03 16:33:14 momjian Exp $
* $PostgreSQL: pgsql/contrib/pg_upgrade/util.c,v 1.5 2010/07/06 19:18:55 momjian Exp $
*/
#include "pg_upgrade.h"

@ -5,7 +5,7 @@
* to control oid and relfilenode assignment
*
* Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade_support/pg_upgrade_support.c,v 1.4 2010/07/03 16:33:15 momjian Exp $
* $PostgreSQL: pgsql/contrib/pg_upgrade_support/pg_upgrade_support.c,v 1.5 2010/07/06 19:18:55 momjian Exp $
*/
#include "postgres.h"
@ -122,4 +122,3 @@ add_pg_enum_label(PG_FUNCTION_ARGS)
PG_RETURN_VOID();
}

@ -4,7 +4,7 @@
* A simple benchmark program for PostgreSQL
* Originally written by Tatsuo Ishii and enhanced by many contributors.
*
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.98 2010/03/23 01:29:22 itagaki Exp $
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.99 2010/07/06 19:18:55 momjian Exp $
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
* ALL RIGHTS RESERVED;
*
@ -2407,8 +2407,8 @@ pthread_create(pthread_t *thread,
/*
* Set a different random seed in each child process. Otherwise they all
* inherit the parent's state and generate the same "random" sequence.
* (In the threaded case, the different threads will obtain subsets of the
* inherit the parent's state and generate the same "random" sequence. (In
* the threaded case, the different threads will obtain subsets of the
* output of a single random() sequence, which should be okay for our
* purposes.)
*/

@ -33,7 +33,7 @@
*
* $From: sha2.c,v 1.1 2001/11/08 00:01:51 adg Exp adg $
*
* $PostgreSQL: pgsql/contrib/pgcrypto/sha2.c,v 1.12 2010/04/02 15:21:20 mha Exp $
* $PostgreSQL: pgsql/contrib/pgcrypto/sha2.c,v 1.13 2010/07/06 19:18:55 momjian Exp $
*/
#include "postgres.h"

@ -1,5 +1,5 @@
/*
* $PostgreSQL: pgsql/contrib/xml2/xpath.c,v 1.29 2010/03/03 19:10:22 tgl Exp $
* $PostgreSQL: pgsql/contrib/xml2/xpath.c,v 1.30 2010/07/06 19:18:55 momjian Exp $
*
* Parser interface for DOM-based parser (libxml) rather than
* stream-based SAX-type parser
@ -631,8 +631,8 @@ xpath_table(PG_FUNCTION_ARGS)
}
/*
* Setup the parser. This should happen after we are done evaluating
* the query, in case it calls functions that set up libxml differently.
* Setup the parser. This should happen after we are done evaluating the
* query, in case it calls functions that set up libxml differently.
*/
pgxml_parser_init();

@ -1,5 +1,5 @@
/*
* $PostgreSQL: pgsql/contrib/xml2/xslt_proc.c,v 1.20 2010/03/03 19:10:22 tgl Exp $
* $PostgreSQL: pgsql/contrib/xml2/xslt_proc.c,v 1.21 2010/07/06 19:18:55 momjian Exp $
*
* XSLT processing functions (requiring libxslt)
*
@ -28,7 +28,6 @@
#include <libxslt/xsltInternals.h>
#include <libxslt/transform.h>
#include <libxslt/xsltutils.h>
#endif /* USE_LIBXSLT */
@ -45,7 +44,6 @@ extern void pgxml_parser_init(void);
static void parse_params(const char **params, text *paramstr);
#define MAXPARAMS 20 /* must be even, see parse_params() */
#endif /* USE_LIBXSLT */
@ -130,14 +128,12 @@ xslt_process(PG_FUNCTION_ARGS)
PG_RETURN_NULL();
PG_RETURN_TEXT_P(cstring_to_text_with_len((char *) resstr, reslen));
#else /* !USE_LIBXSLT */
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("xslt_process() is not available without libxslt")));
PG_RETURN_NULL();
#endif /* USE_LIBXSLT */
}

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.291 2010/05/02 22:37:43 tgl Exp $
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.292 2010/07/06 19:18:55 momjian Exp $
*
*
* INTERFACE ROUTINES
@ -4127,9 +4127,9 @@ heap_xlog_clean(XLogRecPtr lsn, XLogRecord *record)
* We're about to remove tuples. In Hot Standby mode, ensure that there's
* no queries running for which the removed tuples are still visible.
*
* Not all HEAP2_CLEAN records remove tuples with xids, so we only want
* to conflict on the records that cause MVCC failures for user queries.
* If latestRemovedXid is invalid, skip conflict processing.
* Not all HEAP2_CLEAN records remove tuples with xids, so we only want to
* conflict on the records that cause MVCC failures for user queries. If
* latestRemovedXid is invalid, skip conflict processing.
*/
if (InHotStandby && TransactionIdIsValid(xlrec->latestRemovedXid))
ResolveRecoveryConflictWithSnapshot(xlrec->latestRemovedXid,

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/heap/pruneheap.c,v 1.24 2010/04/22 02:15:45 sriggs Exp $
* $PostgreSQL: pgsql/src/backend/access/heap/pruneheap.c,v 1.25 2010/07/06 19:18:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -122,7 +122,8 @@ heap_page_prune_opt(Relation relation, Buffer buffer, TransactionId OldestXmin)
*/
if (PageIsFull(page) || PageGetHeapFreeSpace(page) < minfree)
{
TransactionId ignore = InvalidTransactionId; /* return value not needed */
TransactionId ignore = InvalidTransactionId; /* return value not
* needed */
/* OK to prune */
(void) heap_page_prune(relation, buffer, OldestXmin, true, &ignore);

@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtpage.c,v 1.122 2010/03/28 09:27:01 sriggs Exp $
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtpage.c,v 1.123 2010/07/06 19:18:55 momjian Exp $
*
* NOTES
* Postgres btree pages look like ordinary relation pages. The opaque
@ -847,8 +847,8 @@ _bt_delitems_delete(Relation rel, Buffer buf,
rdata[0].next = &(rdata[1]);
/*
* We need the target-offsets array whether or not we store the
* to allow us to find the latestRemovedXid on a standby server.
* We need the target-offsets array whether or not we store the to
* allow us to find the latestRemovedXid on a standby server.
*/
rdata[1].data = (char *) itemnos;
rdata[1].len = nitems * sizeof(OffsetNumber);

@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.68 2010/04/30 06:34:29 heikki Exp $
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.69 2010/07/06 19:18:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -569,9 +569,12 @@ btree_xlog_delete_get_latestRemovedXid(XLogRecord *record)
{
xl_btree_delete *xlrec = (xl_btree_delete *) XLogRecGetData(record);
OffsetNumber *unused;
Buffer ibuffer, hbuffer;
Page ipage, hpage;
ItemId iitemid, hitemid;
Buffer ibuffer,
hbuffer;
Page ipage,
hpage;
ItemId iitemid,
hitemid;
IndexTuple itup;
HeapTupleHeader htuphdr;
BlockNumber hblkno;
@ -581,10 +584,10 @@ btree_xlog_delete_get_latestRemovedXid(XLogRecord *record)
int i;
/*
* If there's nothing running on the standby we don't need to derive
* a full latestRemovedXid value, so use a fast path out of here.
* That returns InvalidTransactionId, and so will conflict with
* users, but since we just worked out that's zero people, its OK.
* If there's nothing running on the standby we don't need to derive a
* full latestRemovedXid value, so use a fast path out of here. That
* returns InvalidTransactionId, and so will conflict with users, but
* since we just worked out that's zero people, its OK.
*/
if (CountDBBackends(InvalidOid) == 0)
return latestRemovedXid;
@ -598,8 +601,8 @@ btree_xlog_delete_get_latestRemovedXid(XLogRecord *record)
ipage = (Page) BufferGetPage(ibuffer);
/*
* Loop through the deleted index items to obtain the TransactionId
* from the heap items they point to.
* Loop through the deleted index items to obtain the TransactionId from
* the heap items they point to.
*/
unused = (OffsetNumber *) ((char *) xlrec + SizeOfBtreeDelete);
@ -624,8 +627,8 @@ btree_xlog_delete_get_latestRemovedXid(XLogRecord *record)
hpage = (Page) BufferGetPage(hbuffer);
/*
* Look up the heap tuple header that the index tuple points at
* by using the heap node supplied with the xlrec. We can't use
* Look up the heap tuple header that the index tuple points at by
* using the heap node supplied with the xlrec. We can't use
* heap_fetch, since it uses ReadBuffer rather than XLogReadBuffer.
* Note that we are not looking at tuple data here, just headers.
*/
@ -651,8 +654,8 @@ btree_xlog_delete_get_latestRemovedXid(XLogRecord *record)
htuphdr = (HeapTupleHeader) PageGetItem(hpage, hitemid);
/*
* Get the heap tuple's xmin/xmax and ratchet up the latestRemovedXid.
* No need to consider xvac values here.
* Get the heap tuple's xmin/xmax and ratchet up the
* latestRemovedXid. No need to consider xvac values here.
*/
htupxid = HeapTupleHeaderGetXmin(htuphdr);
if (TransactionIdFollows(htupxid, latestRemovedXid))
@ -667,7 +670,8 @@ btree_xlog_delete_get_latestRemovedXid(XLogRecord *record)
/*
* Conjecture: if hitemid is dead then it had xids before the xids
* marked on LP_NORMAL items. So we just ignore this item and move
* onto the next, for the purposes of calculating latestRemovedxids.
* onto the next, for the purposes of calculating
* latestRemovedxids.
*/
}
else
@ -679,13 +683,12 @@ btree_xlog_delete_get_latestRemovedXid(XLogRecord *record)
UnlockReleaseBuffer(ibuffer);
/*
* Note that if all heap tuples were LP_DEAD then we will be
* returning InvalidTransactionId here. That can happen if we are
* re-replaying this record type, though that will be before the
* consistency point and will not cause problems. It should
* happen very rarely after the consistency point, though note
* that we can't tell the difference between this and the fast
* path exit above. May need to change that in future.
* Note that if all heap tuples were LP_DEAD then we will be returning
* InvalidTransactionId here. That can happen if we are re-replaying this
* record type, though that will be before the consistency point and will
* not cause problems. It should happen very rarely after the consistency
* point, though note that we can't tell the difference between this and
* the fast path exit above. May need to change that in future.
*/
return latestRemovedXid;
}
@ -954,6 +957,7 @@ btree_redo(XLogRecPtr lsn, XLogRecord *record)
switch (info)
{
case XLOG_BTREE_DELETE:
/*
* Btree delete records can conflict with standby queries. You
* might think that vacuum records would conflict as well, but
@ -972,6 +976,7 @@ btree_redo(XLogRecPtr lsn, XLogRecord *record)
break;
case XLOG_BTREE_REUSE_PAGE:
/*
* Btree reuse page records exist to provide a conflict point
* when we reuse pages in the index via the FSM. That's all it

@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.61 2010/04/28 00:09:05 tgl Exp $
* $PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.62 2010/07/06 19:18:55 momjian Exp $
*
* NOTES
* Each global transaction is associated with a global transaction

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.292 2010/06/29 18:44:58 momjian Exp $
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.293 2010/07/06 19:18:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -1057,9 +1057,9 @@ RecordTransactionCommit(void)
* Asynchronous commit case:
*
* This enables possible committed transaction loss in the case of a
* postmaster crash because WAL buffers are left unwritten.
* Ideally we could issue the WAL write without the fsync, but
* some wal_sync_methods do not allow separate write/fsync.
* postmaster crash because WAL buffers are left unwritten. Ideally we
* could issue the WAL write without the fsync, but some
* wal_sync_methods do not allow separate write/fsync.
*
* Report the latest async commit LSN, so that the WAL writer knows to
* flush this commit.
@ -1354,12 +1354,12 @@ RecordTransactionAbort(bool isSubXact)
/*
* Report the latest async abort LSN, so that the WAL writer knows to
* flush this abort. There's nothing to be gained by delaying this,
* since WALWriter may as well do this when it can. This is important
* with streaming replication because if we don't flush WAL regularly
* we will find that large aborts leave us with a long backlog for
* when commits occur after the abort, increasing our window of data
* loss should problems occur at that point.
* flush this abort. There's nothing to be gained by delaying this, since
* WALWriter may as well do this when it can. This is important with
* streaming replication because if we don't flush WAL regularly we will
* find that large aborts leave us with a long backlog for when commits
* occur after the abort, increasing our window of data loss should
* problems occur at that point.
*/
if (!isSubXact)
XLogSetAsyncCommitLSN(XactLastRecEnd);

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.429 2010/07/03 22:15:45 tgl Exp $
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.430 2010/07/06 19:18:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -379,6 +379,7 @@ typedef struct XLogCtlData
int XLogCacheBlck; /* highest allocated xlog buffer index */
TimeLineID ThisTimeLineID;
TimeLineID RecoveryTargetTLI;
/*
* archiveCleanupCommand is read from recovery.conf but needs to be in
* shared memory so that the bgwriter process can access it.
@ -2139,13 +2140,14 @@ XLogBackgroundFlush(void)
}
/*
* If already known flushed, we're done. Just need to check if we
* are holding an open file handle to a logfile that's no longer
* in use, preventing the file from being deleted.
* If already known flushed, we're done. Just need to check if we are
* holding an open file handle to a logfile that's no longer in use,
* preventing the file from being deleted.
*/
if (XLByteLE(WriteRqstPtr, LogwrtResult.Flush))
{
if (openLogFile >= 0) {
if (openLogFile >= 0)
{
if (!XLByteInPrevSeg(LogwrtResult.Write, openLogId, openLogSeg))
{
XLogFileClose();
@ -4348,8 +4350,8 @@ writeTimeLineHistory(TimeLineID newTLI, TimeLineID parentTLI,
XLogFileName(xlogfname, endTLI, endLogId, endLogSeg);
/*
* Write comment to history file to explain why and where timeline changed.
* Comment varies according to the recovery target used.
* Write comment to history file to explain why and where timeline
* changed. Comment varies according to the recovery target used.
*/
if (recoveryTarget == RECOVERY_TARGET_XID)
snprintf(buffer, sizeof(buffer),
@ -5029,8 +5031,8 @@ parseRecoveryCommandFileLine(char *cmdline, char **key_p, char **value_p)
*key_p = *value_p = NULL;
/*
* Allocate the buffer on first use. It's used to hold both the
* parameter name and value.
* Allocate the buffer on first use. It's used to hold both the parameter
* name and value.
*/
if (buf == NULL)
buf = malloc(MAXPGPATH + 1);
@ -5604,8 +5606,8 @@ void
GetXLogReceiptTime(TimestampTz *rtime, bool *fromStream)
{
/*
* This must be executed in the startup process, since we don't export
* the relevant state to shared memory.
* This must be executed in the startup process, since we don't export the
* relevant state to shared memory.
*/
Assert(InRecovery);
@ -5637,8 +5639,8 @@ static void
CheckRequiredParameterValues(void)
{
/*
* For archive recovery, the WAL must be generated with at least
* 'archive' wal_level.
* For archive recovery, the WAL must be generated with at least 'archive'
* wal_level.
*/
if (InArchiveRecovery && ControlFile->wal_level == WAL_LEVEL_MINIMAL)
{
@ -5648,8 +5650,8 @@ CheckRequiredParameterValues(void)
}
/*
* For Hot Standby, the WAL must be generated with 'hot_standby' mode,
* and we must have at least as many backend slots as the primary.
* For Hot Standby, the WAL must be generated with 'hot_standby' mode, and
* we must have at least as many backend slots as the primary.
*/
if (InArchiveRecovery && EnableHotStandby)
{
@ -5785,8 +5787,9 @@ StartupXLOG(void)
ControlFile->checkPointCopy.ThisTimeLineID)));
/*
* Save the selected recovery target timeline ID and archive_cleanup_command
* in shared memory so that other processes can see them
* Save the selected recovery target timeline ID and
* archive_cleanup_command in shared memory so that other processes can
* see them
*/
XLogCtl->RecoveryTargetTLI = recoveryTargetTLI;
strncpy(XLogCtl->archiveCleanupCommand,
@ -5940,6 +5943,7 @@ StartupXLOG(void)
if (InRecovery)
{
int rmid;
/* use volatile pointer to prevent code rearrangement */
volatile XLogCtlData *xlogctl = XLogCtl;
@ -6008,8 +6012,8 @@ StartupXLOG(void)
CheckRequiredParameterValues();
/*
* Initialize for Hot Standby, if enabled. We won't let backends
* in yet, not until we've reached the min recovery point specified in
* Initialize for Hot Standby, if enabled. We won't let backends in
* yet, not until we've reached the min recovery point specified in
* control file and we've established a recovery snapshot from a
* running-xacts WAL record.
*/
@ -6038,9 +6042,9 @@ StartupXLOG(void)
/*
* If we're beginning at a shutdown checkpoint, we know that
* nothing was running on the master at this point. So fake-up
* an empty running-xacts record and use that here and now.
* Recover additional standby state for prepared transactions.
* nothing was running on the master at this point. So fake-up an
* empty running-xacts record and use that here and now. Recover
* additional standby state for prepared transactions.
*/
if (wasShutdown)
{
@ -6048,10 +6052,10 @@ StartupXLOG(void)
TransactionId latestCompletedXid;
/*
* Construct a RunningTransactions snapshot representing a shut
* down server, with only prepared transactions still alive.
* We're never overflowed at this point because all subxids
* are listed with their parent prepared transactions.
* Construct a RunningTransactions snapshot representing a
* shut down server, with only prepared transactions still
* alive. We're never overflowed at this point because all
* subxids are listed with their parent prepared transactions.
*/
running.xcnt = nxids;
running.subxid_overflow = false;
@ -6081,12 +6085,12 @@ StartupXLOG(void)
* recoveryLastXTime.
*
* This is slightly confusing if we're starting from an online
* checkpoint; we've just read and replayed the chekpoint record,
* but we're going to start replay from its redo pointer, which
* precedes the location of the checkpoint record itself. So even
* though the last record we've replayed is indeed ReadRecPtr, we
* haven't replayed all the preceding records yet. That's OK for
* the current use of these variables.
* checkpoint; we've just read and replayed the chekpoint record, but
* we're going to start replay from its redo pointer, which precedes
* the location of the checkpoint record itself. So even though the
* last record we've replayed is indeed ReadRecPtr, we haven't
* replayed all the preceding records yet. That's OK for the current
* use of these variables.
*/
SpinLockAcquire(&xlogctl->info_lck);
xlogctl->replayEndRecPtr = ReadRecPtr;
@ -6098,12 +6102,11 @@ StartupXLOG(void)
XLogReceiptTime = GetCurrentTimestamp();
/*
* Let postmaster know we've started redo now, so that it can
* launch bgwriter to perform restartpoints. We don't bother
* during crash recovery as restartpoints can only be performed
* during archive recovery. And we'd like to keep crash recovery
* simple, to avoid introducing bugs that could affect you when
* recovering after crash.
* Let postmaster know we've started redo now, so that it can launch
* bgwriter to perform restartpoints. We don't bother during crash
* recovery as restartpoints can only be performed during archive
* recovery. And we'd like to keep crash recovery simple, to avoid
* introducing bugs that could affect you when recovering after crash.
*
* After this point, we can no longer assume that we're the only
* process in addition to postmaster! Also, fsync requests are
@ -6117,7 +6120,8 @@ StartupXLOG(void)
}
/*
* Allow read-only connections immediately if we're consistent already.
* Allow read-only connections immediately if we're consistent
* already.
*/
CheckRecoveryConsistency();
@ -6214,7 +6218,10 @@ StartupXLOG(void)
xlogctl->replayEndRecPtr = EndRecPtr;
SpinLockRelease(&xlogctl->info_lck);
/* If we are attempting to enter Hot Standby mode, process XIDs we see */
/*
* If we are attempting to enter Hot Standby mode, process
* XIDs we see
*/
if (standbyState >= STANDBY_INITIALIZED &&
TransactionIdIsValid(record->xl_xid))
RecordKnownAssignedTransactionIds(record->xl_xid);
@ -6560,9 +6567,9 @@ CheckRecoveryConsistency(void)
}
/*
* Have we got a valid starting snapshot that will allow
* queries to be run? If so, we can tell postmaster that the
* database is consistent now, enabling connections.
* Have we got a valid starting snapshot that will allow queries to be
* run? If so, we can tell postmaster that the database is consistent now,
* enabling connections.
*/
if (standbyState == STANDBY_SNAPSHOT_READY &&
!backendsAllowed &&
@ -7400,8 +7407,8 @@ CreateCheckPoint(int flags)
{
/*
* Calculate the last segment that we need to retain because of
* wal_keep_segments, by subtracting wal_keep_segments from the
* new checkpoint location.
* wal_keep_segments, by subtracting wal_keep_segments from the new
* checkpoint location.
*/
if (wal_keep_segments > 0)
{
@ -7589,10 +7596,10 @@ CreateRestartPoint(int flags)
* restartpoint, we can't perform a new restart point. We still update
* minRecoveryPoint in that case, so that if this is a shutdown restart
* point, we won't start up earlier than before. That's not strictly
* necessary, but when hot standby is enabled, it would be rather
* weird if the database opened up for read-only connections at a
* point-in-time before the last shutdown. Such time travel is still
* possible in case of immediate shutdown, though.
* necessary, but when hot standby is enabled, it would be rather weird if
* the database opened up for read-only connections at a point-in-time
* before the last shutdown. Such time travel is still possible in case of
* immediate shutdown, though.
*
* We don't explicitly advance minRecoveryPoint when we do create a
* restartpoint. It's assumed that flushing the buffers will do that as a
@ -7621,9 +7628,9 @@ CreateRestartPoint(int flags)
}
/*
* Update the shared RedoRecPtr so that the startup process can
* calculate the number of segments replayed since last restartpoint,
* and request a restartpoint if it exceeds checkpoint_segments.
* Update the shared RedoRecPtr so that the startup process can calculate
* the number of segments replayed since last restartpoint, and request a
* restartpoint if it exceeds checkpoint_segments.
*
* You need to hold WALInsertLock and info_lck to update it, although
* during recovery acquiring WALInsertLock is just pro forma, because
@ -7802,12 +7809,11 @@ XLogReportParameters(void)
max_locks_per_xact != ControlFile->max_locks_per_xact)
{
/*
* The change in number of backend slots doesn't need to be
* WAL-logged if archiving is not enabled, as you can't start
* archive recovery with wal_level=minimal anyway. We don't
* really care about the values in pg_control either if
* wal_level=minimal, but seems better to keep them up-to-date
* to avoid confusion.
* The change in number of backend slots doesn't need to be WAL-logged
* if archiving is not enabled, as you can't start archive recovery
* with wal_level=minimal anyway. We don't really care about the
* values in pg_control either if wal_level=minimal, but seems better
* to keep them up-to-date to avoid confusion.
*/
if (wal_level != ControlFile->wal_level || XLogIsNeeded())
{
@ -7874,9 +7880,9 @@ xlog_redo(XLogRecPtr lsn, XLogRecord *record)
SetTransactionIdLimit(checkPoint.oldestXid, checkPoint.oldestXidDB);
/*
* If we see a shutdown checkpoint while waiting for an
* end-of-backup record, the backup was cancelled and the
* end-of-backup record will never arrive.
* If we see a shutdown checkpoint while waiting for an end-of-backup
* record, the backup was cancelled and the end-of-backup record will
* never arrive.
*/
if (InArchiveRecovery &&
!XLogRecPtrIsInvalid(ControlFile->backupStartPoint))
@ -7884,10 +7890,10 @@ xlog_redo(XLogRecPtr lsn, XLogRecord *record)
(errmsg("online backup was cancelled, recovery cannot continue")));
/*
* If we see a shutdown checkpoint, we know that nothing was
* running on the master at this point. So fake-up an empty
* running-xacts record and use that here and now. Recover
* additional standby state for prepared transactions.
* If we see a shutdown checkpoint, we know that nothing was running
* on the master at this point. So fake-up an empty running-xacts
* record and use that here and now. Recover additional standby state
* for prepared transactions.
*/
if (standbyState >= STANDBY_INITIALIZED)
{
@ -7901,9 +7907,9 @@ xlog_redo(XLogRecPtr lsn, XLogRecord *record)
/*
* Construct a RunningTransactions snapshot representing a shut
* down server, with only prepared transactions still alive.
* We're never overflowed at this point because all subxids
* are listed with their parent prepared transactions.
* down server, with only prepared transactions still alive. We're
* never overflowed at this point because all subxids are listed
* with their parent prepared transactions.
*/
running.xcnt = nxids;
running.subxid_overflow = false;
@ -8021,13 +8027,14 @@ xlog_redo(XLogRecPtr lsn, XLogRecord *record)
ControlFile->max_prepared_xacts = xlrec.max_prepared_xacts;
ControlFile->max_locks_per_xact = xlrec.max_locks_per_xact;
ControlFile->wal_level = xlrec.wal_level;
/*
* Update minRecoveryPoint to ensure that if recovery is aborted,
* we recover back up to this point before allowing hot standby
* again. This is particularly important if wal_level was set to
* 'archive' before, and is now 'hot_standby', to ensure you don't
* run queries against the WAL preceding the wal_level change.
* Same applies to decreasing max_* settings.
* Update minRecoveryPoint to ensure that if recovery is aborted, we
* recover back up to this point before allowing hot standby again.
* This is particularly important if wal_level was set to 'archive'
* before, and is now 'hot_standby', to ensure you don't run queries
* against the WAL preceding the wal_level change. Same applies to
* decreasing max_* settings.
*/
minRecoveryPoint = ControlFile->minRecoveryPoint;
if ((minRecoveryPoint.xlogid != 0 || minRecoveryPoint.xrecoff != 0)
@ -8623,17 +8630,17 @@ pg_stop_backup(PG_FUNCTION_ARGS)
/*
* If archiving is enabled, wait for all the required WAL files to be
* archived before returning. If archiving isn't enabled, the required
* WAL needs to be transported via streaming replication (hopefully
* with wal_keep_segments set high enough), or some more exotic
* mechanism like polling and copying files from pg_xlog with script.
* We have no knowledge of those mechanisms, so it's up to the user to
* ensure that he gets all the required WAL.
* archived before returning. If archiving isn't enabled, the required WAL
* needs to be transported via streaming replication (hopefully with
* wal_keep_segments set high enough), or some more exotic mechanism like
* polling and copying files from pg_xlog with script. We have no
* knowledge of those mechanisms, so it's up to the user to ensure that he
* gets all the required WAL.
*
* We wait until both the last WAL file filled during backup and the
* history file have been archived, and assume that the alphabetic
* sorting property of the WAL files ensures any earlier WAL files are
* safely archived as well.
* history file have been archived, and assume that the alphabetic sorting
* property of the WAL files ensures any earlier WAL files are safely
* archived as well.
*
* We wait forever, since archive_command is supposed to work and we
* assume the admin wanted his backup to work completely. If you don't
@ -9277,8 +9284,8 @@ XLogPageRead(XLogRecPtr *RecPtr, int emode, bool fetching_ckpt,
if (readFile >= 0 && !XLByteInSeg(*RecPtr, readId, readSeg))
{
/*
* Signal bgwriter to start a restartpoint if we've replayed too
* much xlog since the last one.
* Signal bgwriter to start a restartpoint if we've replayed too much
* xlog since the last one.
*/
if (StandbyMode && bgwriterLaunched)
{
@ -9318,12 +9325,12 @@ retry:
/*
* If we find an invalid record in the WAL streamed from
* master, something is seriously wrong. There's little
* chance that the problem will just go away, but PANIC
* is not good for availability either, especially in
* hot standby mode. Disconnect, and retry from
* archive/pg_xlog again. The WAL in the archive should
* be identical to what was streamed, so it's unlikely
* that it helps, but one can hope...
* chance that the problem will just go away, but PANIC is
* not good for availability either, especially in hot
* standby mode. Disconnect, and retry from
* archive/pg_xlog again. The WAL in the archive should be
* identical to what was streamed, so it's unlikely that
* it helps, but one can hope...
*/
if (failedSources & XLOG_FROM_STREAM)
{
@ -9338,8 +9345,8 @@ retry:
* WAL from walreceiver and observe that we had already
* processed everything before the most recent "chunk"
* that it flushed to disk. In steady state where we are
* keeping up with the incoming data, XLogReceiptTime
* will be updated on each cycle. When we are behind,
* keeping up with the incoming data, XLogReceiptTime will
* be updated on each cycle. When we are behind,
* XLogReceiptTime will not advance, so the grace time
* alloted to conflicting queries will decrease.
*/
@ -9442,15 +9449,15 @@ retry:
/*
* If primary_conninfo is set, launch walreceiver to
* try to stream the missing WAL, before retrying
* to restore from archive/pg_xlog.
* try to stream the missing WAL, before retrying to
* restore from archive/pg_xlog.
*
* If fetching_ckpt is TRUE, RecPtr points to the
* initial checkpoint location. In that case, we use
* RedoStartLSN as the streaming start position instead
* of RecPtr, so that when we later jump backwards to
* start redo at RedoStartLSN, we will have the logs
* streamed already.
* RedoStartLSN as the streaming start position
* instead of RecPtr, so that when we later jump
* backwards to start redo at RedoStartLSN, we will
* have the logs streamed already.
*/
if (PrimaryConnInfo)
{
@ -9474,10 +9481,10 @@ retry:
failedSources |= sources;
/*
* Check to see if the trigger file exists. Note that
* we do this only after failure, so when you create
* the trigger file, we still finish replaying as much
* as we can from archive and pg_xlog before failover.
* Check to see if the trigger file exists. Note that we
* do this only after failure, so when you create the
* trigger file, we still finish replaying as much as we
* can from archive and pg_xlog before failover.
*/
if (CheckForStandbyTrigger())
goto triggered;
@ -9515,8 +9522,8 @@ retry:
}
/*
* At this point, we have the right segment open and if we're streaming
* we know the requested record is in it.
* At this point, we have the right segment open and if we're streaming we
* know the requested record is in it.
*/
Assert(readFile != -1);

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/aclchk.c,v 1.167 2010/06/13 17:43:12 rhaas Exp $
* $PostgreSQL: pgsql/src/backend/catalog/aclchk.c,v 1.168 2010/07/06 19:18:55 momjian Exp $
*
* NOTES
* See acl.h.
@ -1188,8 +1188,8 @@ SetDefaultACL(InternalDefaultACL *iacls)
/*
* If the result is the same as the default value, we do not need an
* explicit pg_default_acl entry, and should in fact remove the entry
* if it exists. Must sort both arrays to compare properly.
* explicit pg_default_acl entry, and should in fact remove the entry if
* it exists. Must sort both arrays to compare properly.
*/
aclitemsort(new_acl);
aclitemsort(def_acl);

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/pg_proc.c,v 1.175 2010/05/11 04:52:28 itagaki Exp $
* $PostgreSQL: pgsql/src/backend/catalog/pg_proc.c,v 1.176 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/pg_shdepend.c,v 1.42 2010/07/03 13:53:13 rhaas Exp $
* $PostgreSQL: pgsql/src/backend/catalog/pg_shdepend.c,v 1.43 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -413,8 +413,8 @@ updateAclDependencies(Oid classId, Oid objectId, int32 objsubId,
int i;
/*
* Remove entries that are common to both lists; those represent
* existing dependencies we don't need to change.
* Remove entries that are common to both lists; those represent existing
* dependencies we don't need to change.
*
* OK to overwrite the inputs since we'll pfree them anyway.
*/

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.197 2010/06/01 00:33:23 momjian Exp $
* $PostgreSQL: pgsql/src/backend/commands/indexcmds.c,v 1.198 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -788,11 +788,11 @@ CheckMutability(Expr *expr)
* important consequences. First, function default arguments will get
* inserted, which may affect volatility (consider "default now()").
* Second, inline-able functions will get inlined, which may allow us to
* conclude that the function is really less volatile than it's marked.
* As an example, polymorphic functions must be marked with the most
* volatile behavior that they have for any input type, but once we
* inline the function we may be able to conclude that it's not so
* volatile for the particular input type we're dealing with.
* conclude that the function is really less volatile than it's marked. As
* an example, polymorphic functions must be marked with the most volatile
* behavior that they have for any input type, but once we inline the
* function we may be able to conclude that it's not so volatile for the
* particular input type we're dealing with.
*
* We assume here that expression_planner() won't scribble on its input.
*/

@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/opclasscmds.c,v 1.67 2010/07/03 13:53:13 rhaas Exp $
* $PostgreSQL: pgsql/src/backend/commands/opclasscmds.c,v 1.68 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/

@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/operatorcmds.c,v 1.46 2010/06/22 11:36:16 rhaas Exp $
* $PostgreSQL: pgsql/src/backend/commands/operatorcmds.c,v 1.47 2010/07/06 19:18:56 momjian Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
@ -89,9 +89,9 @@ DefineOperator(List *names, List *parameters)
oprNamespace = QualifiedNameGetCreationNamespace(names, &oprName);
/*
* The SQL standard committee has decided that => should be used for
* named parameters; therefore, a future release of PostgreSQL may
* disallow it as the name of a user-defined operator.
* The SQL standard committee has decided that => should be used for named
* parameters; therefore, a future release of PostgreSQL may disallow it
* as the name of a user-defined operator.
*/
if (strcmp(oprName, "=>") == 0)
ereport(WARNING,

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.331 2010/07/01 14:10:21 rhaas Exp $
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.332 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -1959,8 +1959,8 @@ renameatt(Oid myrelid,
/*
* Renaming the columns of sequences or toast tables doesn't actually
* break anything from the system's point of view, since internal
* references are by attnum. But it doesn't seem right to allow users
* to change names that are hardcoded into the system, hence the following
* references are by attnum. But it doesn't seem right to allow users to
* change names that are hardcoded into the system, hence the following
* restriction.
*/
relkind = RelationGetForm(targetrelation)->relkind;

@ -40,7 +40,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.75 2010/07/02 02:44:32 momjian Exp $
* $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.76 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/

@ -29,7 +29,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.135 2010/04/22 02:15:45 sriggs Exp $
* $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.136 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -399,9 +399,11 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
vacrelstats);
/* Remove tuples from heap */
lazy_vacuum_heap(onerel, vacrelstats);
/*
* Forget the now-vacuumed tuples, and press on, but be careful
* not to reset latestRemovedXid since we want that value to be valid.
* not to reset latestRemovedXid since we want that value to be
* valid.
*/
vacrelstats->num_dead_tuples = 0;
vacrelstats->num_index_scans++;
@ -492,6 +494,7 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
*/
tups_vacuumed += heap_page_prune(onerel, buf, OldestXmin, false,
&vacrelstats->latestRemovedXid);
/*
* Now scan the page to collect vacuumable items and check for tuples
* requiring freezing.
@ -682,9 +685,11 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
{
/* Remove tuples from heap */
lazy_vacuum_page(onerel, blkno, buf, 0, vacrelstats);
/*
* Forget the now-vacuumed tuples, and press on, but be careful
* not to reset latestRemovedXid since we want that value to be valid.
* not to reset latestRemovedXid since we want that value to be
* valid.
*/
vacrelstats->num_dead_tuples = 0;
vacuumed_pages++;

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.172 2010/05/29 02:32:08 momjian Exp $
* $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.173 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -1310,8 +1310,8 @@ retry:
/*
* We should have found our tuple in the index, unless we exited the loop
* early because of conflict. Complain if not. If we ever implement
* '<>' index opclasses, this check will fail and will have to be removed.
* early because of conflict. Complain if not. If we ever implement '<>'
* index opclasses, this check will fail and will have to be removed.
*/
if (!found_self && !conflict)
ereport(ERROR,

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.143 2010/03/19 22:54:40 tgl Exp $
* $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.144 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -939,9 +939,9 @@ sql_exec_error_callback(void *arg)
else
{
/*
* Assume we failed during init_sql_fcache(). (It's possible that
* the function actually has an empty body, but in that case we may
* as well report all errors as being "during startup".)
* Assume we failed during init_sql_fcache(). (It's possible that the
* function actually has an empty body, but in that case we may as
* well report all errors as being "during startup".)
*/
errcontext("SQL function \"%s\" during startup", fcache->fname);
}

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/nodeMergejoin.c,v 1.102 2010/05/28 01:14:03 tgl Exp $
* $PostgreSQL: pgsql/src/backend/executor/nodeMergejoin.c,v 1.103 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -748,6 +748,7 @@ ExecMergeJoin(MergeJoinState *node)
switch (MJEvalInnerValues(node, innerTupleSlot))
{
case MJEVAL_MATCHABLE:
/*
* OK, we have the initial tuples. Begin by skipping
* non-matching tuples.
@ -922,6 +923,7 @@ ExecMergeJoin(MergeJoinState *node)
switch (MJEvalInnerValues(node, innerTupleSlot))
{
case MJEVAL_MATCHABLE:
/*
* Test the new inner tuple to see if it matches
* outer.
@ -944,6 +946,7 @@ ExecMergeJoin(MergeJoinState *node)
}
break;
case MJEVAL_NONMATCHABLE:
/*
* It contains a NULL and hence can't match any outer
* tuple, so we can skip the comparison and assume the
@ -952,10 +955,11 @@ ExecMergeJoin(MergeJoinState *node)
node->mj_JoinState = EXEC_MJ_NEXTOUTER;
break;
case MJEVAL_ENDOFJOIN:
/*
* No more inner tuples. However, this might be
* only effective and not physical end of inner plan,
* so force mj_InnerTupleSlot to null to make sure we
* No more inner tuples. However, this might be only
* effective and not physical end of inner plan, so
* force mj_InnerTupleSlot to null to make sure we
* don't fetch more inner tuples. (We need this hack
* because we are not transiting to a state where the
* inner plan is assumed to be exhausted.)
@ -1152,9 +1156,11 @@ ExecMergeJoin(MergeJoinState *node)
node->mj_JoinState = EXEC_MJ_SKIP_TEST;
break;
case MJEVAL_NONMATCHABLE:
/*
* current inner can't possibly match any outer;
* better to advance the inner scan than the outer.
* better to advance the inner scan than the
* outer.
*/
node->mj_JoinState = EXEC_MJ_SKIPINNER_ADVANCE;
break;
@ -1337,6 +1343,7 @@ ExecMergeJoin(MergeJoinState *node)
node->mj_JoinState = EXEC_MJ_SKIP_TEST;
break;
case MJEVAL_NONMATCHABLE:
/*
* current inner can't possibly match any outer;
* better to advance the inner scan than the outer.

@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/backend/lib/stringinfo.c,v 1.53 2010/05/08 16:39:49 tgl Exp $
* $PostgreSQL: pgsql/src/backend/lib/stringinfo.c,v 1.54 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -226,8 +226,8 @@ appendBinaryStringInfo(StringInfo str, const char *data, int datalen)
/*
* Keep a trailing null in place, even though it's probably useless for
* binary data. (Some callers are dealing with text but call this
* because their input isn't null-terminated.)
* binary data. (Some callers are dealing with text but call this because
* their input isn't null-terminated.)
*/
str->data[str->len] = '\0';
}

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.202 2010/06/29 04:12:47 petere Exp $
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.203 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -369,13 +369,13 @@ ClientAuthentication(Port *port)
/*
* An explicit "reject" entry in pg_hba.conf. This report exposes
* the fact that there's an explicit reject entry, which is perhaps
* not so desirable from a security standpoint; but the message
* for an implicit reject could confuse the DBA a lot when the
* true situation is a match to an explicit reject. And we don't
* want to change the message for an implicit reject. As noted
* below, the additional information shown here doesn't expose
* anything not known to an attacker.
* the fact that there's an explicit reject entry, which is
* perhaps not so desirable from a security standpoint; but the
* message for an implicit reject could confuse the DBA a lot when
* the true situation is a match to an explicit reject. And we
* don't want to change the message for an implicit reject. As
* noted below, the additional information shown here doesn't
* expose anything not known to an attacker.
*/
{
char hostinfo[NI_MAXHOST];

@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/libpq/be-secure.c,v 1.101 2010/05/26 16:15:57 tgl Exp $
* $PostgreSQL: pgsql/src/backend/libpq/be-secure.c,v 1.102 2010/07/06 19:18:56 momjian Exp $
*
* Since the server static private key ($DataDir/server.key)
* will normally be stored unencrypted so that the database
@ -720,6 +720,7 @@ static void
initialize_SSL(void)
{
struct stat buf;
STACK_OF(X509_NAME) *root_cert_list = NULL;
if (!SSL_context)

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.208 2010/06/03 19:29:38 petere Exp $
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.209 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -1016,9 +1016,10 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
line_num, HbaFileName)));
return false;
}
/*
* SSPI authentication can never be enabled on ctLocal connections, because
* it's only supported on Windows, where ctLocal isn't supported.
* SSPI authentication can never be enabled on ctLocal connections,
* because it's only supported on Windows, where ctLocal isn't supported.
*/

@ -59,7 +59,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.217 2010/04/19 00:55:25 rhaas Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/path/costsize.c,v 1.218 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -1854,8 +1854,8 @@ cost_mergejoin(MergePath *path, PlannerInfo *root, SpecialJoinInfo *sjinfo)
cpu_operator_cost * inner_path_rows * rescanratio;
/*
* Prefer materializing if it looks cheaper, unless the user has asked
* to suppress materialization.
* Prefer materializing if it looks cheaper, unless the user has asked to
* suppress materialization.
*/
if (enable_material && mat_inner_cost < bare_inner_cost)
path->materialize_inner = true;
@ -1872,9 +1872,9 @@ cost_mergejoin(MergePath *path, PlannerInfo *root, SpecialJoinInfo *sjinfo)
* selected as the input of a mergejoin, and they don't support
* mark/restore at present.
*
* We don't test the value of enable_material here, because materialization
* is required for correctness in this case, and turning it off does not
* entitle us to deliver an invalid plan.
* We don't test the value of enable_material here, because
* materialization is required for correctness in this case, and turning
* it off does not entitle us to deliver an invalid plan.
*/
else if (innersortkeys == NIL &&
!ExecSupportsMarkRestore(inner_path->pathtype))
@ -1887,8 +1887,9 @@ cost_mergejoin(MergePath *path, PlannerInfo *root, SpecialJoinInfo *sjinfo)
* We don't try to adjust the cost estimates for this consideration,
* though.
*
* Since materialization is a performance optimization in this case, rather
* than necessary for correctness, we skip it if enable_material is off.
* Since materialization is a performance optimization in this case,
* rather than necessary for correctness, we skip it if enable_material is
* off.
*/
else if (enable_material && innersortkeys != NIL &&
relation_byte_size(inner_path_rows, inner_path->parent->width) >

@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/plan/analyzejoins.c,v 1.2 2010/05/23 16:34:38 tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/plan/analyzejoins.c,v 1.3 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -46,8 +46,8 @@ remove_useless_joins(PlannerInfo *root, List *joinlist)
ListCell *lc;
/*
* We are only interested in relations that are left-joined to, so we
* can scan the join_info_list to find them easily.
* We are only interested in relations that are left-joined to, so we can
* scan the join_info_list to find them easily.
*/
restart:
foreach(lc, root->join_info_list)
@ -346,10 +346,10 @@ remove_rel_from_query(PlannerInfo *root, int relid)
/*
* Likewise remove references from SpecialJoinInfo data structures.
*
* This is relevant in case the outer join we're deleting is nested
* inside other outer joins: the upper joins' relid sets have to be
* adjusted. The RHS of the target outer join will be made empty here,
* but that's OK since caller will delete that SpecialJoinInfo entirely.
* This is relevant in case the outer join we're deleting is nested inside
* other outer joins: the upper joins' relid sets have to be adjusted.
* The RHS of the target outer join will be made empty here, but that's OK
* since caller will delete that SpecialJoinInfo entirely.
*/
foreach(l, root->join_info_list)
{

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/plan/planagg.c,v 1.52 2010/05/10 16:25:46 tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/plan/planagg.c,v 1.53 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -654,8 +654,8 @@ attach_notnull_index_qual(MinMaxAggInfo *info, IndexScan *iplan)
RowCompareExpr *rc = (RowCompareExpr *) qual;
/*
* Examine just the first column of the rowcompare, which is
* what determines its placement in the overall qual list.
* Examine just the first column of the rowcompare, which is what
* determines its placement in the overall qual list.
*/
leftop = (Expr *) linitial(rc->largs);

@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/plan/planmain.c,v 1.118 2010/03/28 22:59:33 tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/plan/planmain.c,v 1.119 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/

@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/prep/prepjointree.c,v 1.72 2010/06/21 00:14:48 tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/prep/prepjointree.c,v 1.73 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/

@ -22,7 +22,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/prep/prepunion.c,v 1.182 2010/05/11 15:31:37 tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/prep/prepunion.c,v 1.183 2010/07/06 19:18:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -1268,8 +1268,8 @@ expand_inherited_rtentry(PlannerInfo *root, RangeTblEntry *rte, Index rti)
* if this is the parent table, leave copyObject's result alone.
*
* Note: we need to do this even though the executor won't run any
* permissions checks on the child RTE. The modifiedCols bitmap
* may be examined for trigger-firing purposes.
* permissions checks on the child RTE. The modifiedCols bitmap may
* be examined for trigger-firing purposes.
*/
if (childOID != parentOID)
{

@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/util/placeholder.c,v 1.7 2010/03/28 22:59:33 tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/util/placeholder.c,v 1.8 2010/07/06 19:18:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/parse_expr.c,v 1.255 2010/06/30 18:10:23 heikki Exp $
* $PostgreSQL: pgsql/src/backend/parser/parse_expr.c,v 1.256 2010/07/06 19:18:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -1238,38 +1238,39 @@ transformFuncCall(ParseState *pstate, FuncCall *fn)
/*
* pg_get_expr() is a system function that exposes the expression
* deparsing functionality in ruleutils.c to users. Very handy, but
* it was later realized that the functions in ruleutils.c don't check
* the input rigorously, assuming it to come from system catalogs and
* to therefore be valid. That makes it easy for a user to crash the
* backend by passing a maliciously crafted string representation of
* an expression to pg_get_expr().
* deparsing functionality in ruleutils.c to users. Very handy, but it was
* later realized that the functions in ruleutils.c don't check the input
* rigorously, assuming it to come from system catalogs and to therefore
* be valid. That makes it easy for a user to crash the backend by passing
* a maliciously crafted string representation of an expression to
* pg_get_expr().
*
* There's a lot of code in ruleutils.c, so it's not feasible to add
* water-proof input checking after the fact. Even if we did it once,
* it would need to be taken into account in any future patches too.
* water-proof input checking after the fact. Even if we did it once, it
* would need to be taken into account in any future patches too.
*
* Instead, we restrict pg_rule_expr() to only allow input from system
* catalogs instead. This is a hack, but it's the most robust and easiest
* to backpatch way of plugging the vulnerability.
*
* This is transparent to the typical usage pattern of
* "pg_get_expr(systemcolumn, ...)", but will break
* "pg_get_expr('foo', ...)", even if 'foo' is a valid expression fetched
* earlier from a system catalog. Hopefully there's isn't many clients
* doing that out there.
* "pg_get_expr(systemcolumn, ...)", but will break "pg_get_expr('foo',
* ...)", even if 'foo' is a valid expression fetched earlier from a
* system catalog. Hopefully there's isn't many clients doing that out
* there.
*/
if (result && IsA(result, FuncExpr) &&!superuser())
{
FuncExpr *fe = (FuncExpr *) result;
if (fe->funcid == F_PG_GET_EXPR || fe->funcid == F_PG_GET_EXPR_EXT)
{
Expr *arg = linitial(fe->args);
bool allowed = false;
/*
* Check that the argument came directly from one of the
* allowed system catalog columns
* Check that the argument came directly from one of the allowed
* system catalog columns
*/
if (IsA(arg, Var))
{

@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/scansup.c,v 1.41 2010/05/09 02:15:59 tgl Exp $
* $PostgreSQL: pgsql/src/backend/parser/scansup.c,v 1.42 2010/07/06 19:18:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/

@ -10,7 +10,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/port/sysv_shmem.c,v 1.56 2010/05/01 22:46:30 tgl Exp $
* $PostgreSQL: pgsql/src/backend/port/sysv_shmem.c,v 1.57 2010/07/06 19:18:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -93,13 +93,13 @@ InternalIpcMemoryCreate(IpcMemoryKey memKey, Size size)
return NULL;
/*
* Some BSD-derived kernels are known to return EINVAL, not EEXIST,
* if there is an existing segment but it's smaller than "size"
* (this is a result of poorly-thought-out ordering of error tests).
* To distinguish between collision and invalid size in such cases,
* we make a second try with size = 0. These kernels do not test
* size against SHMMIN in the preexisting-segment case, so we will
* not get EINVAL a second time if there is such a segment.
* Some BSD-derived kernels are known to return EINVAL, not EEXIST, if
* there is an existing segment but it's smaller than "size" (this is
* a result of poorly-thought-out ordering of error tests). To
* distinguish between collision and invalid size in such cases, we
* make a second try with size = 0. These kernels do not test size
* against SHMMIN in the preexisting-segment case, so we will not get
* EINVAL a second time if there is such a segment.
*/
if (errno == EINVAL)
{
@ -122,9 +122,9 @@ InternalIpcMemoryCreate(IpcMemoryKey memKey, Size size)
{
/*
* On most platforms we cannot get here because SHMMIN is
* greater than zero. However, if we do succeed in creating
* a zero-size segment, free it and then fall through to
* report the original error.
* greater than zero. However, if we do succeed in creating a
* zero-size segment, free it and then fall through to report
* the original error.
*/
if (shmctl(shmid, IPC_RMID, NULL) < 0)
elog(LOG, "shmctl(%d, %d, 0) failed: %m",

@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/port/win32/socket.c,v 1.26 2010/02/26 02:00:53 momjian Exp $
* $PostgreSQL: pgsql/src/backend/port/win32/socket.c,v 1.27 2010/07/06 19:18:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/

@ -11,7 +11,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/port/win32/timer.c,v 1.18 2010/01/02 16:57:50 momjian Exp $
* $PostgreSQL: pgsql/src/backend/port/win32/timer.c,v 1.19 2010/07/06 19:18:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/

@ -13,7 +13,7 @@
*
* Copyright (c) 2001-2010, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.203 2010/03/24 16:07:10 tgl Exp $
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.204 2010/07/06 19:18:57 momjian Exp $
* ----------
*/
#include "postgres.h"
@ -3288,10 +3288,10 @@ pgstat_write_statsfile(bool permanent)
last_statwrite = globalStats.stats_timestamp;
/*
* If there is clock skew between backends and the collector, we
* could receive a stats request time that's in the future. If so,
* complain and reset last_statrequest. Resetting ensures that no
* inquiry message can cause more than one stats file write to occur.
* If there is clock skew between backends and the collector, we could
* receive a stats request time that's in the future. If so, complain
* and reset last_statrequest. Resetting ensures that no inquiry
* message can cause more than one stats file write to occur.
*/
if (last_statrequest > last_statwrite)
{

@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.613 2010/06/24 16:40:45 rhaas Exp $
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.614 2010/07/06 19:18:57 momjian Exp $
*
* NOTES
*
@ -2180,6 +2180,7 @@ pmdie(SIGNAL_ARGS)
/* and the walwriter too */
if (WalWriterPID != 0)
signal_child(WalWriterPID, SIGTERM);
/*
* If we're in recovery, we can't kill the startup process
* right away, because at present doing so does not release
@ -3033,8 +3034,8 @@ PostmasterStateMachine(void)
* Terminate backup mode to avoid recovery after a clean fast
* shutdown. Since a backup can only be taken during normal
* running (and not, for example, while running under Hot Standby)
* it only makes sense to do this if we reached normal running.
* If we're still in recovery, the backup file is one we're
* it only makes sense to do this if we reached normal running. If
* we're still in recovery, the backup file is one we're
* recovering *from*, and we must keep it around so that recovery
* restarts from the right place.
*/

@ -18,7 +18,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.57 2010/04/16 09:51:49 heikki Exp $
* $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.58 2010/07/06 19:18:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -425,9 +425,9 @@ SysLoggerMain(int argc, char *argv[])
* detect pipe EOF. The main thread just wakes up once a second to
* check for SIGHUP and rotation conditions.
*
* Server code isn't generally thread-safe, so we ensure that only
* one of the threads is active at a time by entering the critical
* section whenever we're not sleeping.
* Server code isn't generally thread-safe, so we ensure that only one
* of the threads is active at a time by entering the critical section
* whenever we're not sleeping.
*/
LeaveCriticalSection(&sysloggerSection);

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c,v 1.11 2010/06/11 10:13:09 heikki Exp $
* $PostgreSQL: pgsql/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c,v 1.12 2010/07/06 19:18:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -86,9 +86,9 @@ libpqrcv_connect(char *conninfo, XLogRecPtr startpoint)
char cmd[64];
/*
* Connect using deliberately undocumented parameter: replication.
* The database name is ignored by the server in replication mode, but
* specify "replication" for .pgpass lookup.
* Connect using deliberately undocumented parameter: replication. The
* database name is ignored by the server in replication mode, but specify
* "replication" for .pgpass lookup.
*/
snprintf(conninfo_repl, sizeof(conninfo_repl),
"%s dbname=replication replication=true",
@ -257,15 +257,14 @@ libpqrcv_PQexec(const char *query)
PGresult *lastResult = NULL;
/*
* PQexec() silently discards any prior query results on the
* connection. This is not required for walreceiver since it's
* expected that walsender won't generate any such junk results.
* PQexec() silently discards any prior query results on the connection.
* This is not required for walreceiver since it's expected that walsender
* won't generate any such junk results.
*/
/*
* Submit a query. Since we don't use non-blocking mode, this also
* can block. But its risk is relatively small, so we ignore that
* for now.
* Submit a query. Since we don't use non-blocking mode, this also can
* block. But its risk is relatively small, so we ignore that for now.
*/
if (!PQsendQuery(streamConn, query))
return NULL;
@ -273,16 +272,16 @@ libpqrcv_PQexec(const char *query)
for (;;)
{
/*
* Receive data until PQgetResult is ready to get the result
* without blocking.
* Receive data until PQgetResult is ready to get the result without
* blocking.
*/
while (PQisBusy(streamConn))
{
/*
* We don't need to break down the sleep into smaller increments,
* and check for interrupts after each nap, since we can just
* elog(FATAL) within SIGTERM signal handler if the signal
* arrives in the middle of establishment of replication connection.
* elog(FATAL) within SIGTERM signal handler if the signal arrives
* in the middle of establishment of replication connection.
*/
if (!libpq_select(-1))
continue; /* interrupted */
@ -291,10 +290,9 @@ libpqrcv_PQexec(const char *query)
}
/*
* Emulate the PQexec()'s behavior of returning the last result
* when there are many.
* Since walsender will never generate multiple results, we skip
* the concatenation of error messages.
* Emulate the PQexec()'s behavior of returning the last result when
* there are many. Since walsender will never generate multiple
* results, we skip the concatenation of error messages.
*/
result = PQgetResult(streamConn);
if (result == NULL)

@ -29,7 +29,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/replication/walreceiver.c,v 1.15 2010/07/03 20:43:57 tgl Exp $
* $PostgreSQL: pgsql/src/backend/replication/walreceiver.c,v 1.16 2010/07/06 19:18:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -159,6 +159,7 @@ WalReceiverMain(void)
{
char conninfo[MAXCONNINFO];
XLogRecPtr startpoint;
/* use volatile pointer to prevent code rearrangement */
volatile WalRcvData *walrcv = WalRcv;

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/replication/walreceiverfuncs.c,v 1.6 2010/07/03 20:43:57 tgl Exp $
* $PostgreSQL: pgsql/src/backend/replication/walreceiverfuncs.c,v 1.7 2010/07/06 19:18:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/

@ -28,7 +28,7 @@
* Portions Copyright (c) 2010-2010, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.27 2010/06/17 16:41:25 tgl Exp $
* $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.28 2010/07/06 19:18:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -66,7 +66,8 @@ bool am_walsender = false; /* Am I a walsender process ? */
int max_wal_senders = 0; /* the maximum number of concurrent walsenders */
int WalSndDelay = 200; /* max sleep time between some actions */
#define NAPTIME_PER_CYCLE 100000L /* max sleep time between cycles (100ms) */
#define NAPTIME_PER_CYCLE 100000L /* max sleep time between cycles
* (100ms) */
/*
* These variables are used similarly to openLogFile/Id/Seg/Off,
@ -266,10 +267,10 @@ WalSndHandshake(void)
* NOTE: This only checks the current value of
* wal_level. Even if the current setting is not
* 'minimal', there can be old WAL in the pg_xlog
* directory that was created with 'minimal'.
* So this is not bulletproof, the purpose is
* just to give a user-friendly error message that
* hints how to configure the system correctly.
* directory that was created with 'minimal'. So this
* is not bulletproof, the purpose is just to give a
* user-friendly error message that hints how to
* configure the system correctly.
*/
if (wal_level == WAL_LEVEL_MINIMAL)
ereport(FATAL,
@ -422,8 +423,8 @@ WalSndLoop(void)
*
* On some platforms, signals won't interrupt the sleep. To ensure we
* respond reasonably promptly when someone signals us, break down the
* sleep into NAPTIME_PER_CYCLE increments, and check for
* interrupts after each nap.
* sleep into NAPTIME_PER_CYCLE increments, and check for interrupts
* after each nap.
*/
if (caughtup)
{
@ -563,13 +564,14 @@ XLogRead(char *buf, XLogRecPtr recptr, Size nbytes)
if (sendFile < 0)
{
/*
* If the file is not found, assume it's because the
* standby asked for a too old WAL segment that has already
* been removed or recycled.
* If the file is not found, assume it's because the standby
* asked for a too old WAL segment that has already been
* removed or recycled.
*/
if (errno == ENOENT)
{
char filename[MAXFNAMELEN];
XLogFileName(filename, ThisTimeLineID, sendId, sendSeg);
ereport(ERROR,
(errcode_for_file_access(),
@ -619,10 +621,10 @@ XLogRead(char *buf, XLogRecPtr recptr, Size nbytes)
}
/*
* After reading into the buffer, check that what we read was valid.
* We do this after reading, because even though the segment was present
* when we opened it, it might get recycled or removed while we read it.
* The read() succeeds in that case, but the data we tried to read might
* After reading into the buffer, check that what we read was valid. We do
* this after reading, because even though the segment was present when we
* opened it, it might get recycled or removed while we read it. The
* read() succeeds in that case, but the data we tried to read might
* already have been overwritten with new WAL records.
*/
XLogGetLastRemoved(&lastRemovedLog, &lastRemovedSeg);
@ -631,6 +633,7 @@ XLogRead(char *buf, XLogRecPtr recptr, Size nbytes)
(log == lastRemovedLog && seg <= lastRemovedSeg))
{
char filename[MAXFNAMELEN];
XLogFileName(filename, ThisTimeLineID, log, seg);
ereport(ERROR,
(errcode_for_file_access(),
@ -662,8 +665,8 @@ XLogSend(char *msgbuf, bool *caughtup)
WalDataMessageHeader msghdr;
/*
* Attempt to send all data that's already been written out and fsync'd
* to disk. We cannot go further than what's been written out given the
* Attempt to send all data that's already been written out and fsync'd to
* disk. We cannot go further than what's been written out given the
* current implementation of XLogRead(). And in any case it's unsafe to
* send WAL that is not securely down to disk on the master: if the master
* subsequently crashes and restarts, slaves must not have applied any WAL
@ -683,19 +686,18 @@ XLogSend(char *msgbuf, bool *caughtup)
* MAX_SEND_SIZE bytes to send, send everything. Otherwise send
* MAX_SEND_SIZE bytes, but round back to logfile or page boundary.
*
* The rounding is not only for performance reasons. Walreceiver
* relies on the fact that we never split a WAL record across two
* messages. Since a long WAL record is split at page boundary into
* continuation records, page boundary is always a safe cut-off point.
* We also assume that SendRqstPtr never points to the middle of a WAL
* record.
* The rounding is not only for performance reasons. Walreceiver relies on
* the fact that we never split a WAL record across two messages. Since a
* long WAL record is split at page boundary into continuation records,
* page boundary is always a safe cut-off point. We also assume that
* SendRqstPtr never points to the middle of a WAL record.
*/
startptr = sentPtr;
if (startptr.xrecoff >= XLogFileSize)
{
/*
* crossing a logid boundary, skip the non-existent last log
* segment in previous logical log file.
* crossing a logid boundary, skip the non-existent last log segment
* in previous logical log file.
*/
startptr.xlogid += 1;
startptr.xrecoff = 0;
@ -739,8 +741,8 @@ XLogSend(char *msgbuf, bool *caughtup)
XLogRead(msgbuf + 1 + sizeof(WalDataMessageHeader), startptr, nbytes);
/*
* We fill the message header last so that the send timestamp is taken
* as late as possible.
* We fill the message header last so that the send timestamp is taken as
* late as possible.
*/
msghdr.dataStart = startptr;
msghdr.walEnd = SendRqstPtr;
@ -931,4 +933,5 @@ GetOldestWALSendPointer(void)
}
return oldest;
}
#endif

@ -11,7 +11,7 @@
* as a service.
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/file/copydir.c,v 1.1 2010/07/02 17:03:30 rhaas Exp $
* $PostgreSQL: pgsql/src/backend/storage/file/copydir.c,v 1.2 2010/07/06 19:18:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -229,9 +229,9 @@ fsync_fname(char *fname, bool isdir)
int returncode;
/*
* Some OSs require directories to be opened read-only whereas
* other systems don't allow us to fsync files opened read-only; so
* we need both cases here
* Some OSs require directories to be opened read-only whereas other
* systems don't allow us to fsync files opened read-only; so we need both
* cases here
*/
if (!isdir)
fd = BasicOpenFile(fname,
@ -243,8 +243,8 @@ fsync_fname(char *fname, bool isdir)
S_IRUSR | S_IWUSR);
/*
* Some OSs don't allow us to open directories at all
* (Windows returns EACCES)
* Some OSs don't allow us to open directories at all (Windows returns
* EACCES)
*/
if (fd < 0 && isdir && (errno == EISDIR || errno == EACCES))
return;

@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/ipc/ipc.c,v 1.107 2010/03/20 00:58:09 tgl Exp $
* $PostgreSQL: pgsql/src/backend/storage/ipc/ipc.c,v 1.108 2010/07/06 19:18:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -165,13 +165,13 @@ proc_exit_prepare(int code)
CritSectionCount = 0;
/*
* Also clear the error context stack, to prevent error callbacks
* from being invoked by any elog/ereport calls made during proc_exit.
* Whatever context they might want to offer is probably not relevant,
* and in any case they are likely to fail outright after we've done
* things like aborting any open transaction. (In normal exit scenarios
* the context stack should be empty anyway, but it might not be in the
* case of elog(FATAL) for example.)
* Also clear the error context stack, to prevent error callbacks from
* being invoked by any elog/ereport calls made during proc_exit. Whatever
* context they might want to offer is probably not relevant, and in any
* case they are likely to fail outright after we've done things like
* aborting any open transaction. (In normal exit scenarios the context
* stack should be empty anyway, but it might not be in the case of
* elog(FATAL) for example.)
*/
error_context_stack = NULL;
/* For the same reason, reset debug_query_string before it's clobbered */

@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/ipc/procarray.c,v 1.71 2010/07/03 21:23:58 tgl Exp $
* $PostgreSQL: pgsql/src/backend/storage/ipc/procarray.c,v 1.72 2010/07/06 19:18:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -181,9 +181,9 @@ ProcArrayShmemSize(void)
* since we may at times copy the whole of the data structures around. We
* refer to this size as TOTAL_MAX_CACHED_SUBXIDS.
*
* Ideally we'd only create this structure if we were actually doing
* hot standby in the current run, but we don't know that yet at the
* time shared memory is being set up.
* Ideally we'd only create this structure if we were actually doing hot
* standby in the current run, but we don't know that yet at the time
* shared memory is being set up.
*/
#define TOTAL_MAX_CACHED_SUBXIDS \
((PGPROC_MAX_CACHED_SUBXIDS + 1) * PROCARRAY_MAXPROCS)
@ -523,8 +523,8 @@ ProcArrayApplyRecoveryInfo(RunningTransactions running)
/*
* Remove all xids except xids later than the snapshot. We don't know
* exactly which ones that is until precisely now, so that is why we
* allow xids to be added only to remove most of them again here.
* exactly which ones that is until precisely now, so that is why we allow
* xids to be added only to remove most of them again here.
*/
ExpireOldKnownAssignedTransactionIds(running->nextXid);
StandbyReleaseOldLocks(running->nextXid);
@ -536,41 +536,40 @@ ProcArrayApplyRecoveryInfo(RunningTransactions running)
/*
* Combine the running xact data with already known xids, if any exist.
* KnownAssignedXids is sorted so we cannot just add new xids, we have
* to combine them first, sort them and then re-add to KnownAssignedXids.
* KnownAssignedXids is sorted so we cannot just add new xids, we have to
* combine them first, sort them and then re-add to KnownAssignedXids.
*
* Some of the new xids are top-level xids and some are subtransactions. We
* don't call SubtransSetParent because it doesn't matter yet. If we aren't
* overflowed then all xids will fit in snapshot and so we don't need
* subtrans. If we later overflow, an xid assignment record will add xids
* to subtrans. If RunningXacts is overflowed then we don't have enough
* information to correctly update subtrans anyway.
* Some of the new xids are top-level xids and some are subtransactions.
* We don't call SubtransSetParent because it doesn't matter yet. If we
* aren't overflowed then all xids will fit in snapshot and so we don't
* need subtrans. If we later overflow, an xid assignment record will add
* xids to subtrans. If RunningXacts is overflowed then we don't have
* enough information to correctly update subtrans anyway.
*/
/*
* Allocate a temporary array so we can combine xids. The total
* of both arrays should never normally exceed TOTAL_MAX_CACHED_SUBXIDS.
* Allocate a temporary array so we can combine xids. The total of both
* arrays should never normally exceed TOTAL_MAX_CACHED_SUBXIDS.
*/
xids = palloc(sizeof(TransactionId) * TOTAL_MAX_CACHED_SUBXIDS);
/*
* Get the remaining KnownAssignedXids. In most cases there won't
* be any at all since this exists only to catch a theoretical
* race condition.
* Get the remaining KnownAssignedXids. In most cases there won't be any
* at all since this exists only to catch a theoretical race condition.
*/
nxids = KnownAssignedXidsGet(xids, InvalidTransactionId);
if (nxids > 0)
KnownAssignedXidsDisplay(trace_recovery(DEBUG3));
/*
* Now we have a copy of any KnownAssignedXids we can zero the
* array before we re-insertion of combined snapshot.
* Now we have a copy of any KnownAssignedXids we can zero the array
* before we re-insertion of combined snapshot.
*/
KnownAssignedXidsRemovePreceding(InvalidTransactionId);
/*
* Add to the temp array any xids which have not already completed,
* taking care not to overflow in extreme cases.
* Add to the temp array any xids which have not already completed, taking
* care not to overflow in extreme cases.
*/
for (i = 0; i < running->xcnt; i++)
{
@ -597,7 +596,8 @@ ProcArrayApplyRecoveryInfo(RunningTransactions running)
if (nxids > 0)
{
/*
* Sort the array so that we can add them safely into KnownAssignedXids.
* Sort the array so that we can add them safely into
* KnownAssignedXids.
*/
qsort(xids, nxids, sizeof(TransactionId), xidComparator);
@ -622,23 +622,21 @@ ProcArrayApplyRecoveryInfo(RunningTransactions running)
pfree(xids);
/*
* Now we've got the running xids we need to set the global values
* thare used to track snapshots as they evolve further
* Now we've got the running xids we need to set the global values thare
* used to track snapshots as they evolve further
*
* * latestCompletedXid which will be the xmax for snapshots
* * lastOverflowedXid which shows whether snapshots overflow
* * nextXid
* * latestCompletedXid which will be the xmax for snapshots *
* lastOverflowedXid which shows whether snapshots overflow * nextXid
*
* If the snapshot overflowed, then we still initialise with what we know,
* but the recovery snapshot isn't fully valid yet because we know there
* are some subxids missing.
* We don't know the specific subxids that are missing, so conservatively
* assume the last one is latestObservedXid. If no missing subxids,
* try to clear lastOverflowedXid.
* are some subxids missing. We don't know the specific subxids that are
* missing, so conservatively assume the last one is latestObservedXid.
* If no missing subxids, try to clear lastOverflowedXid.
*
* If the snapshot didn't overflow it's still possible that an overflow
* occurred in the gap between taking snapshot and logging record, so
* we also need to check if lastOverflowedXid is already ahead of us.
* occurred in the gap between taking snapshot and logging record, so we
* also need to check if lastOverflowedXid is already ahead of us.
*/
if (running->subxid_overflow)
{
@ -933,10 +931,10 @@ TransactionIdIsInProgress(TransactionId xid)
/*
* If the KnownAssignedXids overflowed, we have to check pg_subtrans
* too. Fetch all xids from KnownAssignedXids that are lower than xid,
* since if xid is a subtransaction its parent will always have a
* lower value. Note we will collect both main and subXIDs here,
* but there's no help for it.
* too. Fetch all xids from KnownAssignedXids that are lower than
* xid, since if xid is a subtransaction its parent will always have a
* lower value. Note we will collect both main and subXIDs here, but
* there's no help for it.
*/
if (TransactionIdPrecedesOrEquals(xid, procArray->lastOverflowedXid))
nxids = KnownAssignedXidsGet(xids, xid);
@ -1117,15 +1115,16 @@ GetOldestXmin(bool allDbs, bool ignoreVacuum)
LWLockRelease(ProcArrayLock);
/*
* Compute the cutoff XID, being careful not to generate a "permanent" XID.
* Compute the cutoff XID, being careful not to generate a "permanent"
* XID.
*
* vacuum_defer_cleanup_age provides some additional "slop" for the
* benefit of hot standby queries on slave servers. This is quick and
* dirty, and perhaps not all that useful unless the master has a
* predictable transaction rate, but it's what we've got. Note that
* we are assuming vacuum_defer_cleanup_age isn't large enough to cause
* wraparound --- so guc.c should limit it to no more than the xidStopLimit
* threshold in varsup.c.
* predictable transaction rate, but it's what we've got. Note that we
* are assuming vacuum_defer_cleanup_age isn't large enough to cause
* wraparound --- so guc.c should limit it to no more than the
* xidStopLimit threshold in varsup.c.
*/
result -= vacuum_defer_cleanup_age;
if (!TransactionIdIsNormal(result))
@ -1229,8 +1228,8 @@ GetSnapshotData(Snapshot snapshot)
/*
* If we're in recovery then snapshot data comes from a different place,
* so decide which route we take before grab the lock. It is possible
* for recovery to end before we finish taking snapshot, and for newly
* so decide which route we take before grab the lock. It is possible for
* recovery to end before we finish taking snapshot, and for newly
* assigned transaction ids to be added to the procarray. Xmax cannot
* change while we hold ProcArrayLock, so those newly added transaction
* ids would be filtered away, so we need not be concerned about them.
@ -1240,8 +1239,8 @@ GetSnapshotData(Snapshot snapshot)
if (!snapshot->takenDuringRecovery)
{
/*
* Spin over procArray checking xid, xmin, and subxids. The goal is to
* gather all active xids, find the lowest xmin, and try to record
* Spin over procArray checking xid, xmin, and subxids. The goal is
* to gather all active xids, find the lowest xmin, and try to record
* subxids. During recovery no xids will be assigned, so all normal
* backends can be ignored, nor are there any VACUUMs running. All
* prepared transaction xids are held in KnownAssignedXids, so these
@ -1266,13 +1265,13 @@ GetSnapshotData(Snapshot snapshot)
xid = proc->xid;
/*
* If the transaction has been assigned an xid < xmax we add it to the
* snapshot, and update xmin if necessary. There's no need to store
* XIDs >= xmax, since we'll treat them as running anyway. We don't
* bother to examine their subxids either.
* If the transaction has been assigned an xid < xmax we add it to
* the snapshot, and update xmin if necessary. There's no need to
* store XIDs >= xmax, since we'll treat them as running anyway.
* We don't bother to examine their subxids either.
*
* We don't include our own XID (if any) in the snapshot, but we must
* include it into xmin.
* We don't include our own XID (if any) in the snapshot, but we
* must include it into xmin.
*/
if (TransactionIdIsNormal(xid))
{
@ -1285,16 +1284,17 @@ GetSnapshotData(Snapshot snapshot)
}
/*
* Save subtransaction XIDs if possible (if we've already overflowed,
* there's no point). Note that the subxact XIDs must be later than
* their parent, so no need to check them against xmin. We could
* filter against xmax, but it seems better not to do that much work
* while holding the ProcArrayLock.
* Save subtransaction XIDs if possible (if we've already
* overflowed, there's no point). Note that the subxact XIDs must
* be later than their parent, so no need to check them against
* xmin. We could filter against xmax, but it seems better not to
* do that much work while holding the ProcArrayLock.
*
* The other backend can add more subxids concurrently, but cannot
* remove any. Hence it's important to fetch nxids just once. Should
* be safe to use memcpy, though. (We needn't worry about missing any
* xids added concurrently, because they must postdate xmax.)
* remove any. Hence it's important to fetch nxids just once.
* Should be safe to use memcpy, though. (We needn't worry about
* missing any xids added concurrently, because they must postdate
* xmax.)
*
* Again, our own XIDs are not included in the snapshot.
*/
@ -2350,9 +2350,9 @@ RecordKnownAssignedTransactionIds(TransactionId xid)
TransactionId next_expected_xid;
/*
* Extend clog and subtrans like we do in GetNewTransactionId()
* during normal operation using individual extend steps.
* Typical case requires almost no activity.
* Extend clog and subtrans like we do in GetNewTransactionId() during
* normal operation using individual extend steps. Typical case
* requires almost no activity.
*/
next_expected_xid = latestObservedXid;
TransactionIdAdvance(next_expected_xid);
@ -2534,7 +2534,8 @@ KnownAssignedXidsCompress(bool force)
{
/* use volatile pointer to prevent code rearrangement */
volatile ProcArrayStruct *pArray = procArray;
int head, tail;
int head,
tail;
int compress_index;
int i;
@ -2545,14 +2546,14 @@ KnownAssignedXidsCompress(bool force)
if (!force)
{
/*
* If we can choose how much to compress, use a heuristic to
* avoid compressing too often or not often enough.
* If we can choose how much to compress, use a heuristic to avoid
* compressing too often or not often enough.
*
* Heuristic is if we have a large enough current spread and
* less than 50% of the elements are currently in use, then
* compress. This should ensure we compress fairly infrequently.
* We could compress less often though the virtual array would
* spread out more and snapshots would become more expensive.
* Heuristic is if we have a large enough current spread and less than
* 50% of the elements are currently in use, then compress. This
* should ensure we compress fairly infrequently. We could compress
* less often though the virtual array would spread out more and
* snapshots would become more expensive.
*/
int nelements = head - tail;
@ -2562,8 +2563,8 @@ KnownAssignedXidsCompress(bool force)
}
/*
* We compress the array by reading the valid values from tail
* to head, re-aligning data to 0th element.
* We compress the array by reading the valid values from tail to head,
* re-aligning data to 0th element.
*/
compress_index = 0;
for (i = tail; i < head; i++)
@ -2598,16 +2599,17 @@ KnownAssignedXidsAdd(TransactionId from_xid, TransactionId to_xid,
/* use volatile pointer to prevent code rearrangement */
volatile ProcArrayStruct *pArray = procArray;
TransactionId next_xid;
int head, tail;
int head,
tail;
int nxids;
int i;
Assert(TransactionIdPrecedesOrEquals(from_xid, to_xid));
/*
* Calculate how many array slots we'll need. Normally this is cheap;
* in the unusual case where the XIDs cross the wrap point, we do it the
* hard way.
* Calculate how many array slots we'll need. Normally this is cheap; in
* the unusual case where the XIDs cross the wrap point, we do it the hard
* way.
*/
if (to_xid >= from_xid)
nxids = to_xid - from_xid + 1;
@ -2623,8 +2625,8 @@ KnownAssignedXidsAdd(TransactionId from_xid, TransactionId to_xid,
}
/*
* Since only the startup process modifies the head/tail pointers,
* we don't need a lock to read them here.
* Since only the startup process modifies the head/tail pointers, we
* don't need a lock to read them here.
*/
head = pArray->headKnownAssignedXids;
tail = pArray->tailKnownAssignedXids;
@ -2633,9 +2635,9 @@ KnownAssignedXidsAdd(TransactionId from_xid, TransactionId to_xid,
Assert(tail >= 0 && tail < pArray->maxKnownAssignedXids);
/*
* Verify that insertions occur in TransactionId sequence. Note that
* even if the last existing element is marked invalid, it must still
* have a correctly sequenced XID value.
* Verify that insertions occur in TransactionId sequence. Note that even
* if the last existing element is marked invalid, it must still have a
* correctly sequenced XID value.
*/
if (head > tail &&
TransactionIdFollowsOrEquals(KnownAssignedXids[head - 1], from_xid))
@ -2687,8 +2689,8 @@ KnownAssignedXidsAdd(TransactionId from_xid, TransactionId to_xid,
* ensure that other processors see the above array updates before they
* see the head pointer change.
*
* If we're holding ProcArrayLock exclusively, there's no need to take
* the spinlock.
* If we're holding ProcArrayLock exclusively, there's no need to take the
* spinlock.
*/
if (exclusive_lock)
pArray->headKnownAssignedXids = head;
@ -2714,7 +2716,8 @@ KnownAssignedXidsSearch(TransactionId xid, bool remove)
{
/* use volatile pointer to prevent code rearrangement */
volatile ProcArrayStruct *pArray = procArray;
int first, last;
int first,
last;
int head;
int tail;
int result_index = -1;
@ -2825,12 +2828,12 @@ KnownAssignedXidsRemove(TransactionId xid)
/*
* Note: we cannot consider it an error to remove an XID that's not
* present. We intentionally remove subxact IDs while processing
* XLOG_XACT_ASSIGNMENT, to avoid array overflow. Then those XIDs
* will be removed again when the top-level xact commits or aborts.
* XLOG_XACT_ASSIGNMENT, to avoid array overflow. Then those XIDs will be
* removed again when the top-level xact commits or aborts.
*
* It might be possible to track such XIDs to distinguish this case
* from actual errors, but it would be complicated and probably not
* worth it. So, just ignore the search result.
* It might be possible to track such XIDs to distinguish this case from
* actual errors, but it would be complicated and probably not worth it.
* So, just ignore the search result.
*/
(void) KnownAssignedXidsSearch(xid, true);
}
@ -2869,7 +2872,9 @@ KnownAssignedXidsRemovePreceding(TransactionId removeXid)
/* use volatile pointer to prevent code rearrangement */
volatile ProcArrayStruct *pArray = procArray;
int count = 0;
int head, tail, i;
int head,
tail,
i;
if (!TransactionIdIsValid(removeXid))
{
@ -2882,8 +2887,8 @@ KnownAssignedXidsRemovePreceding(TransactionId removeXid)
elog(trace_recovery(DEBUG4), "prune KnownAssignedXids to %u", removeXid);
/*
* Mark entries invalid starting at the tail. Since array is sorted,
* we can stop as soon as we reach a entry >= removeXid.
* Mark entries invalid starting at the tail. Since array is sorted, we
* can stop as soon as we reach a entry >= removeXid.
*/
tail = pArray->tailKnownAssignedXids;
head = pArray->headKnownAssignedXids;
@ -2961,15 +2966,16 @@ KnownAssignedXidsGetAndSetXmin(TransactionId *xarray, TransactionId *xmin,
/* use volatile pointer to prevent code rearrangement */
volatile ProcArrayStruct *pArray = procArray;
int count = 0;
int head, tail;
int head,
tail;
int i;
/*
* Fetch head just once, since it may change while we loop.
* We can stop once we reach the initially seen head, since
* we are certain that an xid cannot enter and then leave the
* array while we hold ProcArrayLock. We might miss newly-added
* xids, but they should be >= xmax so irrelevant anyway.
* Fetch head just once, since it may change while we loop. We can stop
* once we reach the initially seen head, since we are certain that an xid
* cannot enter and then leave the array while we hold ProcArrayLock. We
* might miss newly-added xids, but they should be >= xmax so irrelevant
* anyway.
*
* Must take spinlock to ensure we see up-to-date array contents.
*/
@ -3025,7 +3031,9 @@ KnownAssignedXidsDisplay(int trace_level)
/* use volatile pointer to prevent code rearrangement */
volatile ProcArrayStruct *pArray = procArray;
StringInfoData buf;
int head, tail, i;
int head,
tail,
i;
int nxids = 0;
tail = pArray->tailKnownAssignedXids;

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/ipc/shmem.c,v 1.104 2010/04/28 16:54:16 tgl Exp $
* $PostgreSQL: pgsql/src/backend/storage/ipc/shmem.c,v 1.105 2010/07/06 19:18:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/

@ -11,7 +11,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/ipc/standby.c,v 1.26 2010/07/03 20:43:58 tgl Exp $
* $PostgreSQL: pgsql/src/backend/storage/ipc/standby.c,v 1.27 2010/07/06 19:18:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -171,8 +171,8 @@ WaitExceedsMaxStandbyDelay(void)
pg_usleep(standbyWait_us);
/*
* Progressively increase the sleep times, but not to more than 1s,
* since pg_usleep isn't interruptable on some platforms.
* Progressively increase the sleep times, but not to more than 1s, since
* pg_usleep isn't interruptable on some platforms.
*/
standbyWait_us *= 2;
if (standbyWait_us > 1000000)
@ -841,11 +841,11 @@ LogStandbySnapshot(TransactionId *oldestActiveXid, TransactionId *nextXid)
/*
* Get details of any AccessExclusiveLocks being held at the moment.
*
* XXX GetRunningTransactionLocks() currently holds a lock on all partitions
* though it is possible to further optimise the locking. By reference
* counting locks and storing the value on the ProcArray entry for each backend
* we can easily tell if any locks need recording without trying to acquire
* the partition locks and scanning the lock table.
* XXX GetRunningTransactionLocks() currently holds a lock on all
* partitions though it is possible to further optimise the locking. By
* reference counting locks and storing the value on the ProcArray entry
* for each backend we can easily tell if any locks need recording without
* trying to acquire the partition locks and scanning the lock table.
*/
locks = GetRunningTransactionLocks(&nlocks);
if (nlocks > 0)
@ -856,10 +856,12 @@ LogStandbySnapshot(TransactionId *oldestActiveXid, TransactionId *nextXid)
* record we write, because standby will open up when it sees this.
*/
running = GetRunningTransactionData();
/*
* The gap between GetRunningTransactionData() and LogCurrentRunningXacts()
* is what most of the fuss is about here, so artifically extending this
* interval is a great way to test the little used parts of the code.
* The gap between GetRunningTransactionData() and
* LogCurrentRunningXacts() is what most of the fuss is about here, so
* artifically extending this interval is a great way to test the little
* used parts of the code.
*/
LogCurrentRunningXacts(running);

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.220 2010/07/03 20:43:58 tgl Exp $
* $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.221 2010/07/06 19:18:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -1664,6 +1664,7 @@ enable_standby_sig_alarm(TimestampTz now, TimestampTz fin_time, bool deadlock_on
long secs;
int usecs;
struct itimerval timeval;
TimestampDifference(now, statement_fin_time,
&secs, &usecs);
if (secs == 0 && usecs == 0)
@ -1722,8 +1723,8 @@ CheckStandbyTimeout(void)
now = GetCurrentTimestamp();
/*
* Reschedule the timer if its not time to wake yet, or if we
* have both timers set and the first one has just been reached.
* Reschedule the timer if its not time to wake yet, or if we have both
* timers set and the first one has just been reached.
*/
if (now >= statement_fin_time)
{
@ -1731,9 +1732,8 @@ CheckStandbyTimeout(void)
{
/*
* We're still waiting when we reach deadlock timeout, so send out
* a request to have other backends check themselves for
* deadlock. Then continue waiting until statement_fin_time,
* if that's set.
* a request to have other backends check themselves for deadlock.
* Then continue waiting until statement_fin_time, if that's set.
*/
SendRecoveryConflictWithBufferPin(PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK);
deadlock_timeout_active = false;
@ -1764,6 +1764,7 @@ CheckStandbyTimeout(void)
long secs;
int usecs;
struct itimerval timeval;
TimestampDifference(now, statement_fin_time,
&secs, &usecs);
if (secs == 0 && usecs == 0)

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.104 2010/06/30 18:10:23 heikki Exp $
* $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.105 2010/07/06 19:18:57 momjian Exp $
*
* NOTES
* This cruft is the server side of PQfn.

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.594 2010/05/12 19:45:02 sriggs Exp $
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.595 2010/07/06 19:18:57 momjian Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@ -2840,8 +2840,8 @@ RecoveryConflictInterrupt(ProcSignalReason reason)
/*
* All conflicts apart from database cause dynamic errors where the
* command or transaction can be retried at a later point with some
* potential for success. No need to reset this, since
* non-retryable conflict errors are currently FATAL.
* potential for success. No need to reset this, since non-retryable
* conflict errors are currently FATAL.
*/
if (reason == PROCSIG_RECOVERY_CONFLICT_DATABASE)
RecoveryConflictRetryable = false;

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/tsearch/ts_typanalyze.c,v 1.9 2010/05/30 21:59:02 tgl Exp $
* $PostgreSQL: pgsql/src/backend/tsearch/ts_typanalyze.c,v 1.10 2010/07/06 19:18:57 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -164,8 +164,8 @@ compute_tsvector_stats(VacAttrStats *stats,
/*
* We want statistics_target * 10 lexemes in the MCELEM array. This
* multiplier is pretty arbitrary, but is meant to reflect the fact that
* the number of individual lexeme values tracked in pg_statistic ought
* to be more than the number of values for a simple scalar column.
* the number of individual lexeme values tracked in pg_statistic ought to
* be more than the number of values for a simple scalar column.
*/
num_mcelem = stats->attr->attstattarget * 10;
@ -332,9 +332,9 @@ compute_tsvector_stats(VacAttrStats *stats,
num_mcelem, bucket_width, lexeme_no, i, track_len);
/*
* If we obtained more lexemes than we really want, get rid of
* those with least frequencies. The easiest way is to qsort the
* array into descending frequency order and truncate the array.
* If we obtained more lexemes than we really want, get rid of those
* with least frequencies. The easiest way is to qsort the array into
* descending frequency order and truncate the array.
*/
if (num_mcelem < track_len)
{
@ -383,8 +383,8 @@ compute_tsvector_stats(VacAttrStats *stats,
mcelem_freqs = (float4 *) palloc((num_mcelem + 2) * sizeof(float4));
/*
* See comments above about use of nonnull_cnt as the divisor
* for the final frequency estimates.
* See comments above about use of nonnull_cnt as the divisor for
* the final frequency estimates.
*/
for (i = 0; i < num_mcelem; i++)
{

@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------
* formatting.c
*
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.170 2010/04/07 21:41:53 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.171 2010/07/06 19:18:58 momjian Exp $
*
*
* Portions Copyright (c) 1999-2010, PostgreSQL Global Development Group
@ -2658,12 +2658,13 @@ DCH_from_char(FormatNode *node, char *in, TmFromChar *out)
s += SKIP_THth(n->suffix);
break;
case DCH_Q:
/*
* We ignore 'Q' when converting to date because it is
* unclear which date in the quarter to use, and some
* people specify both quarter and month, so if it was
* honored it might conflict with the supplied month.
* That is also why we don't throw an error.
* We ignore 'Q' when converting to date because it is unclear
* which date in the quarter to use, and some people specify
* both quarter and month, so if it was honored it might
* conflict with the supplied month. That is also why we don't
* throw an error.
*
* We still parse the source string for an integer, but it
* isn't stored anywhere in 'out'.

@ -19,7 +19,7 @@
* Copyright (c) 1996-2010, PostgreSQL Global Development Group
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/like_match.c,v 1.29 2010/05/28 18:18:19 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/like_match.c,v 1.30 2010/07/06 19:18:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -116,10 +116,10 @@ MatchText(char *t, int tlen, char *p, int plen)
* If there are wildcards immediately following the %, we can skip
* over them first, using the idea that any sequence of N _'s and
* one or more %'s is equivalent to N _'s and one % (ie, it will
* match any sequence of at least N text characters). In this
* way we will always run the recursive search loop using a
* pattern fragment that begins with a literal character-to-match,
* thereby not recursing more than we have to.
* match any sequence of at least N text characters). In this way
* we will always run the recursive search loop using a pattern
* fragment that begins with a literal character-to-match, thereby
* not recursing more than we have to.
*/
NextByte(p, plen);

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/oid.c,v 1.77 2010/06/13 17:43:13 rhaas Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/oid.c,v 1.78 2010/07/06 19:18:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -314,9 +314,11 @@ oidparse(Node *node)
case T_Integer:
return intVal(node);
case T_Float:
/*
* Values too large for int4 will be represented as Float constants
* by the lexer. Accept these if they are valid OID strings.
* Values too large for int4 will be represented as Float
* constants by the lexer. Accept these if they are valid OID
* strings.
*/
return oidin_subr(strVal(node), NULL);
default:

@ -4,7 +4,7 @@
*
* Portions Copyright (c) 2002-2010, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.56 2010/04/26 14:17:52 momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/pg_locale.c,v 1.57 2010/07/06 19:18:58 momjian Exp $
*
*-----------------------------------------------------------------------
*/
@ -428,6 +428,7 @@ PGLC_localeconv(void)
char *grouping;
char *thousands_sep;
int encoding;
#ifdef WIN32
char *save_lc_ctype;
#endif
@ -448,26 +449,26 @@ PGLC_localeconv(void)
save_lc_numeric = pstrdup(save_lc_numeric);
#ifdef WIN32
/*
* Ideally, monetary and numeric local symbols could be returned in
* any server encoding. Unfortunately, the WIN32 API does not allow
* setlocale() to return values in a codepage/CTYPE that uses more
* than two bytes per character, like UTF-8:
* Ideally, monetary and numeric local symbols could be returned in any
* server encoding. Unfortunately, the WIN32 API does not allow
* setlocale() to return values in a codepage/CTYPE that uses more than
* two bytes per character, like UTF-8:
*
* http://msdn.microsoft.com/en-us/library/x99tb11d.aspx
*
* Evidently, LC_CTYPE allows us to control the encoding used
* for strings returned by localeconv(). The Open Group
* standard, mentioned at the top of this C file, doesn't
* explicitly state this.
* Evidently, LC_CTYPE allows us to control the encoding used for strings
* returned by localeconv(). The Open Group standard, mentioned at the
* top of this C file, doesn't explicitly state this.
*
* Therefore, we set LC_CTYPE to match LC_NUMERIC or LC_MONETARY
* (which cannot be UTF8), call localeconv(), and then convert from
* the numeric/monitary LC_CTYPE to the server encoding. One
* example use of this is for the Euro symbol.
* Therefore, we set LC_CTYPE to match LC_NUMERIC or LC_MONETARY (which
* cannot be UTF8), call localeconv(), and then convert from the
* numeric/monitary LC_CTYPE to the server encoding. One example use of
* this is for the Euro symbol.
*
* Perhaps someday we will use GetLocaleInfoW() which returns values
* in UTF16 and convert from that.
* Perhaps someday we will use GetLocaleInfoW() which returns values in
* UTF16 and convert from that.
*/
/* save user's value of ctype locale */
@ -567,6 +568,7 @@ strftime_win32(char *dst, size_t dstlen, const wchar_t *format, const struct tm
len = wcsftime(wbuf, MAX_L10N_DATA, format, tm);
if (len == 0)
/*
* strftime call failed - return 0 with the contents of dst
* unspecified
@ -595,7 +597,6 @@ strftime_win32(char *dst, size_t dstlen, const wchar_t *format, const struct tm
/* redefine strftime() */
#define strftime(a,b,c,d) strftime_win32(a,b,L##c,d)
#endif /* WIN32 */
@ -611,6 +612,7 @@ cache_locale_time(void)
char buf[MAX_L10N_DATA];
char *ptr;
int i;
#ifdef WIN32
char *save_lc_ctype;
#endif
@ -627,13 +629,14 @@ cache_locale_time(void)
save_lc_time = pstrdup(save_lc_time);
#ifdef WIN32
/*
* On WIN32, there is no way to get locale-specific time values in a
* specified locale, like we do for monetary/numeric. We can only get
* CP_ACP (see strftime_win32) or UTF16. Therefore, we get UTF16 and
* convert it to the database locale. However, wcsftime() internally
* uses LC_CTYPE, so we set it here. See the WIN32 comment near the
* top of PGLC_localeconv().
* convert it to the database locale. However, wcsftime() internally uses
* LC_CTYPE, so we set it here. See the WIN32 comment near the top of
* PGLC_localeconv().
*/
/* save user's value of ctype locale */

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.97 2010/03/03 17:29:45 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.98 2010/07/06 19:18:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -1338,8 +1338,8 @@ xml_ereport(int level, int sqlcode, const char *msg)
/*
* It might seem that we should just pass xml_err_buf->data directly to
* errdetail. However, we want to clean out xml_err_buf before throwing
* error, in case there is another function using libxml further down
* the call stack.
* error, in case there is another function using libxml further down the
* call stack.
*/
if (xml_err_buf->len > 0)
{

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/cache/catcache.c,v 1.152 2010/04/20 23:48:47 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/cache/catcache.c,v 1.153 2010/07/06 19:18:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -994,6 +994,7 @@ IndexScanOK(CatCache *cache, ScanKey cur_skey)
switch (cache->id)
{
case INDEXRELID:
/*
* Rather than tracking exactly which indexes have to be loaded
* before we can use indexscans (which changes from time to time),
@ -1006,6 +1007,7 @@ IndexScanOK(CatCache *cache, ScanKey cur_skey)
case AMOID:
case AMNAME:
/*
* Always do heap scans in pg_am, because it's so small there's
* not much point in an indexscan anyway. We *must* do this when
@ -1017,6 +1019,7 @@ IndexScanOK(CatCache *cache, ScanKey cur_skey)
case AUTHNAME:
case AUTHOID:
case AUTHMEMMEMROLE:
/*
* Protect authentication lookups occurring before relcache has
* collected entries for shared indexes.

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.310 2010/04/20 23:48:47 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.311 2010/07/06 19:18:58 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -1847,8 +1847,8 @@ RelationClearRelation(Relation relation, bool rebuild)
Oid old_reltype = relation->rd_rel->reltype;
/*
* As per notes above, a rel to be rebuilt MUST have refcnt > 0; while
* of course it would be a bad idea to blow away one with nonzero refcnt.
* As per notes above, a rel to be rebuilt MUST have refcnt > 0; while of
* course it would be a bad idea to blow away one with nonzero refcnt.
*/
Assert(rebuild ?
!RelationHasReferenceCountZero(relation) :
@ -2051,9 +2051,9 @@ RelationFlushRelation(Relation relation)
* forget the "new" status of the relation, which is a useful
* optimization to have. Ditto for the new-relfilenode status.
*
* The rel could have zero refcnt here, so temporarily increment
* the refcnt to ensure it's safe to rebuild it. We can assume that
* the current transaction has some lock on the rel already.
* The rel could have zero refcnt here, so temporarily increment the
* refcnt to ensure it's safe to rebuild it. We can assume that the
* current transaction has some lock on the rel already.
*/
RelationIncrementReferenceCount(relation);
RelationClearRelation(relation, true);
@ -2775,8 +2775,8 @@ RelationCacheInitializePhase2(void)
RelationMapInitializePhase2();
/*
* In bootstrap mode, the shared catalogs aren't there yet anyway,
* so do nothing.
* In bootstrap mode, the shared catalogs aren't there yet anyway, so do
* nothing.
*/
if (IsBootstrapProcessingMode())
return;

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.212 2010/04/26 10:52:00 rhaas Exp $
* $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.213 2010/07/06 19:18:58 momjian Exp $
*
*
*-------------------------------------------------------------------------
@ -218,7 +218,8 @@ PerformAuthentication(Port *port)
elog(FATAL, "could not disable timer for authorization timeout");
/*
* Log connection for streaming replication even if Log_connections disabled.
* Log connection for streaming replication even if Log_connections
* disabled.
*/
if (am_walsender)
{
@ -515,8 +516,8 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username,
if (IsUnderPostmaster)
{
/*
* The postmaster already started the XLOG machinery, but we need
* to call InitXLOGAccess(), if the system isn't in hot-standby mode.
* The postmaster already started the XLOG machinery, but we need to
* call InitXLOGAccess(), if the system isn't in hot-standby mode.
* This is handled by calling RecoveryInProgress and ignoring the
* result.
*/
@ -525,9 +526,9 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username,
else
{
/*
* We are either a bootstrap process or a standalone backend.
* Either way, start up the XLOG machinery, and register to have it
* closed down at exit.
* We are either a bootstrap process or a standalone backend. Either
* way, start up the XLOG machinery, and register to have it closed
* down at exit.
*/
StartupXLOG();
on_shmem_exit(ShutdownXLOG, 0);
@ -618,8 +619,8 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username,
}
/*
* If we're trying to shut down, only superusers can connect, and
* new replication connections are not allowed.
* If we're trying to shut down, only superusers can connect, and new
* replication connections are not allowed.
*/
if ((!am_superuser || am_walsender) &&
MyProcPort != NULL &&
@ -636,10 +637,10 @@ InitPostgres(const char *in_dbname, Oid dboid, const char *username,
}
/*
* The last few connections slots are reserved for superusers.
* Although replication connections currently require superuser
* privileges, we don't allow them to consume the reserved slots,
* which are intended for interactive use.
* The last few connections slots are reserved for superusers. Although
* replication connections currently require superuser privileges, we
* don't allow them to consume the reserved slots, which are intended for
* interactive use.
*/
if ((!am_superuser || am_walsender) &&
ReservedBackends > 0 &&

@ -4,7 +4,7 @@
*
* Tatsuo Ishii
*
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.95 2010/02/27 03:55:52 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/mb/mbutils.c,v 1.96 2010/07/06 19:18:58 momjian Exp $
*/
#include "postgres.h"

@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.559 2010/07/03 21:23:58 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.560 2010/07/06 19:18:58 momjian Exp $
*
*--------------------------------------------------------------------
*/
@ -5905,12 +5905,13 @@ define_custom_variable(struct config_generic * variable)
case PGC_S_DATABASE:
case PGC_S_USER:
case PGC_S_DATABASE_USER:
/*
* The existing value came from an ALTER ROLE/DATABASE SET command.
* We can assume that at the time the command was issued, we
* checked that the issuing user was superuser if the variable
* requires superuser privileges to set. So it's safe to
* use SUSET context here.
* The existing value came from an ALTER ROLE/DATABASE SET
* command. We can assume that at the time the command was issued,
* we checked that the issuing user was superuser if the variable
* requires superuser privileges to set. So it's safe to use
* SUSET context here.
*/
phcontext = PGC_SUSET;
break;
@ -5918,9 +5919,10 @@ define_custom_variable(struct config_generic * variable)
case PGC_S_CLIENT:
case PGC_S_SESSION:
default:
/*
* We must assume that the value came from an untrusted user,
* even if the current_user is a superuser.
* We must assume that the value came from an untrusted user, even
* if the current_user is a superuser.
*/
phcontext = PGC_USERSET;
break;
@ -7465,19 +7467,19 @@ validate_option_array_item(const char *name, const char *value,
* SUSET and user is superuser).
*
* name is not known, but exists or can be created as a placeholder
* (implying it has a prefix listed in custom_variable_classes).
* We allow this case if you're a superuser, otherwise not. Superusers
* are assumed to know what they're doing. We can't allow it for other
* users, because when the placeholder is resolved it might turn out to
* be a SUSET variable; define_custom_variable assumes we checked that.
* (implying it has a prefix listed in custom_variable_classes). We allow
* this case if you're a superuser, otherwise not. Superusers are assumed
* to know what they're doing. We can't allow it for other users, because
* when the placeholder is resolved it might turn out to be a SUSET
* variable; define_custom_variable assumes we checked that.
*
* name is not known and can't be created as a placeholder. Throw error,
* unless skipIfNoPermissions is true, in which case return FALSE.
* (It's tempting to allow this case to superusers, if the name is
* qualified but not listed in custom_variable_classes. That would
* ease restoring of dumps containing ALTER ROLE/DATABASE SET. However,
* it's not clear that this usage justifies such a loss of error checking.
* You can always fix custom_variable_classes before you restore.)
* unless skipIfNoPermissions is true, in which case return FALSE. (It's
* tempting to allow this case to superusers, if the name is qualified but
* not listed in custom_variable_classes. That would ease restoring of
* dumps containing ALTER ROLE/DATABASE SET. However, it's not clear that
* this usage justifies such a loss of error checking. You can always fix
* custom_variable_classes before you restore.)
*/
gconf = find_option(name, true, WARNING);
if (!gconf)

@ -5,7 +5,7 @@
* to contain some useful information. Mechanism differs wildly across
* platforms.
*
* $PostgreSQL: pgsql/src/backend/utils/misc/ps_status.c,v 1.41 2010/05/27 19:19:38 tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/misc/ps_status.c,v 1.42 2010/07/06 19:18:59 momjian Exp $
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
* various details abducted from various places

@ -12,7 +12,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.119 2010/07/05 09:27:17 heikki Exp $
* $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.120 2010/07/06 19:18:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -775,9 +775,9 @@ AtCleanup_Portals(void)
}
/*
* If a portal is still pinned, forcibly unpin it. PortalDrop will
* not let us drop the portal otherwise. Whoever pinned the portal
* was interrupted by the abort too and won't try to use it anymore.
* If a portal is still pinned, forcibly unpin it. PortalDrop will not
* let us drop the portal otherwise. Whoever pinned the portal was
* interrupted by the abort too and won't try to use it anymore.
*/
if (portal->portalPinned)
portal->portalPinned = false;

@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.186 2010/06/28 02:07:02 tgl Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.187 2010/07/06 19:18:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -2989,8 +2989,8 @@ ReadHead(ArchiveHandle *AH)
/*
* If we haven't already read the header, do so.
*
* NB: this code must agree with _discoverArchiveFormat(). Maybe find
* a way to unify the cases?
* NB: this code must agree with _discoverArchiveFormat(). Maybe find a
* way to unify the cases?
*/
if (!AH->readHeader)
{
@ -3085,8 +3085,8 @@ checkSeek(FILE *fp)
pgoff_t tpos;
/*
* If pgoff_t is wider than long, we must have "real" fseeko and not
* an emulation using fseek. Otherwise report no seek capability.
* If pgoff_t is wider than long, we must have "real" fseeko and not an
* emulation using fseek. Otherwise report no seek capability.
*/
#ifndef HAVE_FSEEKO
if (sizeof(pgoff_t) > sizeof(long))

@ -19,7 +19,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.46 2010/06/28 02:07:02 tgl Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_backup_custom.c,v 1.47 2010/07/06 19:18:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -448,9 +448,9 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te, RestoreOptions *ropt)
if (!ctx->hasSeek || tctx->dataState == K_OFFSET_POS_NOT_SET)
{
/*
* We cannot seek directly to the desired block. Instead, skip
* over block headers until we find the one we want. This could
* fail if we are asked to restore items out-of-order.
* We cannot seek directly to the desired block. Instead, skip over
* block headers until we find the one we want. This could fail if we
* are asked to restore items out-of-order.
*/
_readBlockHeader(AH, &blkType, &id);
@ -836,9 +836,9 @@ _CloseArchive(ArchiveHandle *AH)
/*
* If possible, re-write the TOC in order to update the data offset
* information. This is not essential, as pg_restore can cope in
* most cases without it; but it can make pg_restore significantly
* faster in some situations (especially parallel restore).
* information. This is not essential, as pg_restore can cope in most
* cases without it; but it can make pg_restore significantly faster
* in some situations (especially parallel restore).
*/
if (ctx->hasSeek &&
fseeko(AH->FH, tpos, SEEK_SET) == 0)

@ -25,7 +25,7 @@
* http://archives.postgresql.org/pgsql-bugs/2010-02/msg00187.php
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.580 2010/05/15 21:41:16 tgl Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.581 2010/07/06 19:18:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -3957,8 +3957,8 @@ getIndexes(TableInfo tblinfo[], int numTables)
* find one, create a CONSTRAINT entry linked to the INDEX entry. We
* assume an index won't have more than one internal dependency.
*
* As of 9.0 we don't need to look at pg_depend but can check for
* a match to pg_constraint.conindid. The check on conrelid is
* As of 9.0 we don't need to look at pg_depend but can check for a
* match to pg_constraint.conindid. The check on conrelid is
* redundant but useful because that column is indexed while conindid
* is not.
*/

@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.220 2010/05/21 17:37:44 rhaas Exp $
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.221 2010/07/06 19:18:59 momjian Exp $
*/
#include "postgres_fe.h"
#include "command.h"

@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.145 2010/05/28 20:02:32 tgl Exp $
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.146 2010/07/06 19:18:59 momjian Exp $
*/
#include "postgres_fe.h"
#include "common.h"
@ -1108,18 +1108,18 @@ ExecQueryUsingCursor(const char *query, double *elapsed_msec)
/*
* Make sure to flush the output stream, so intermediate results are
* visible to the client immediately. We check the results because
* if the pager dies/exits/etc, there's no sense throwing more data
* at it.
* visible to the client immediately. We check the results because if
* the pager dies/exits/etc, there's no sense throwing more data at
* it.
*/
flush_error = fflush(pset.queryFout);
/*
* Check if we are at the end, if a cancel was pressed, or if
* there were any errors either trying to flush out the results,
* or more generally on the output stream at all. If we hit any
* errors writing things to the stream, we presume $PAGER has
* disappeared and stop bothering to pull down more data.
* Check if we are at the end, if a cancel was pressed, or if there
* were any errors either trying to flush out the results, or more
* generally on the output stream at all. If we hit any errors
* writing things to the stream, we presume $PAGER has disappeared and
* stop bothering to pull down more data.
*/
if (ntuples < pset.fetch_count || cancel_pressed || flush_error ||
ferror(pset.queryFout))

@ -8,7 +8,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.241 2010/03/11 21:29:32 tgl Exp $
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.242 2010/07/06 19:18:59 momjian Exp $
*/
#include "postgres_fe.h"

@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.127 2010/05/09 18:17:47 tgl Exp $
* $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.128 2010/07/06 19:19:00 momjian Exp $
*/
#include "postgres_fe.h"
@ -2221,6 +2221,7 @@ printTableCleanup(printTableContent *const content)
if (content->cellmustfree)
{
int i;
for (i = 0; i < content->nrows * content->ncolumns; i++)
{
if (content->cellmustfree[i])

@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/print.h,v 1.45 2010/03/01 20:55:45 heikki Exp $
* $PostgreSQL: pgsql/src/bin/psql/print.h,v 1.46 2010/07/06 19:19:00 momjian Exp $
*/
#ifndef PRINT_H
#define PRINT_H

@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.199 2010/06/07 02:59:02 itagaki Exp $
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.200 2010/07/06 19:19:00 momjian Exp $
*/
/*----------------------------------------------------------------------

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/access/nbtree.h,v 1.134 2010/03/28 09:27:02 sriggs Exp $
* $PostgreSQL: pgsql/src/include/access/nbtree.h,v 1.135 2010/07/06 19:19:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -316,7 +316,8 @@ typedef struct xl_btree_delete
{
RelFileNode node; /* RelFileNode of the index */
BlockNumber block;
RelFileNode hnode; /* RelFileNode of the heap the index currently points at */
RelFileNode hnode; /* RelFileNode of the heap the index currently
* points at */
int nitems;
/* TARGET OFFSET NUMBERS FOLLOW AT THE END */

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/nodes/relation.h,v 1.186 2010/03/30 21:58:11 tgl Exp $
* $PostgreSQL: pgsql/src/include/nodes/relation.h,v 1.187 2010/07/06 19:19:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/

@ -1,4 +1,4 @@
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.95 2010/05/28 16:34:15 itagaki Exp $ */
/* $PostgreSQL: pgsql/src/include/port/win32.h,v 1.96 2010/07/06 19:19:00 momjian Exp $ */
#if defined(_MSC_VER) || defined(__BORLANDC__)
#define WIN32_ONLY_COMPILER
@ -63,7 +63,6 @@
#else
#define PGDLLEXPORT __declspec (dllimport)
#endif
#else /* not CYGWIN, not MSVC, not MingW */
#define PGDLLIMPORT
#define PGDLLEXPORT

@ -5,7 +5,7 @@
*
* Portions Copyright (c) 2010-2010, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/include/replication/walprotocol.h,v 1.1 2010/06/03 22:17:32 tgl Exp $
* $PostgreSQL: pgsql/src/include/replication/walprotocol.h,v 1.2 2010/07/06 19:19:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/

@ -5,7 +5,7 @@
*
* Portions Copyright (c) 2010-2010, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/include/replication/walreceiver.h,v 1.10 2010/07/03 20:43:58 tgl Exp $
* $PostgreSQL: pgsql/src/include/replication/walreceiver.h,v 1.11 2010/07/06 19:19:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -42,7 +42,8 @@ typedef struct
{
/*
* PID of currently active walreceiver process, its current state and
* start time (actually, the time at which it was requested to be started).
* start time (actually, the time at which it was requested to be
* started).
*/
pid_t pid;
WalRcvState walRcvState;
@ -51,9 +52,9 @@ typedef struct
/*
* receivedUpto-1 is the last byte position that has already been
* received. When startup process starts the walreceiver, it sets
* receivedUpto to the point where it wants the streaming to begin.
* After that, walreceiver updates this whenever it flushes the received
* WAL to disk.
* receivedUpto to the point where it wants the streaming to begin. After
* that, walreceiver updates this whenever it flushes the received WAL to
* disk.
*/
XLogRecPtr receivedUpto;

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/storage/pmsignal.h,v 1.31 2010/05/15 20:01:32 rhaas Exp $
* $PostgreSQL: pgsql/src/include/storage/pmsignal.h,v 1.32 2010/07/06 19:19:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.122 2010/05/26 19:52:52 sriggs Exp $
* $PostgreSQL: pgsql/src/include/storage/proc.h,v 1.123 2010/07/06 19:19:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save