PostgreSQL
Check-in [4fbde7ff14fe4fc7e404bae776f45cb90073afbf]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
SHA1 Hash:4fbde7ff14fe4fc7e404bae776f45cb90073afbf
Date: 2014-05-15 11:49:11
User: heikki.linnakangas@iki.fi
Comment:Misc message style and doc fixes. Euler Taveira
Tags And Properties
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to doc/src/sgml/ref/pg_recvlogical.sgml

222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
     </varlistentry>

     <varlistentry>
      <term><option>-F <replaceable>interval_seconds</replaceable></option></term>
      <term><option>--fsync-interval=<replaceable>interval_seconds</replaceable></option></term>
      <listitem>
       <para>
        How often should
        <link linkend="app-pgreceivexlog"><application>pg_receivexlog</application></link>
        issue sync commands to ensure the <parameter>--outputfile</parameter>
        is safely flushed to disk without being asked by the server to do
        so. Specifying an interval of <literal>0</literal> disables issuing
        fsyncs altogether, while still reporting progress the server.
        In this case, data may be lost in the event of a crash.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-P <replaceable>plugin</replaceable></option></term>
      <term><option>--plugin=<replaceable>plugin</replaceable></option></term>







|
<
|
|
|
|
|







222
223
224
225
226
227
228
229

230
231
232
233
234
235
236
237
238
239
240
241
     </varlistentry>

     <varlistentry>
      <term><option>-F <replaceable>interval_seconds</replaceable></option></term>
      <term><option>--fsync-interval=<replaceable>interval_seconds</replaceable></option></term>
      <listitem>
       <para>
        How often should <application>pg_recvlogical</application> issue sync

        commands to ensure the <parameter>--outputfile</parameter> is safely
        flushed to disk without being asked by the server to do so. Specifying
        an interval of <literal>0</literal> disables issuing fsyncs altogether,
        while still reporting progress the server.  In this case, data may be
        lost in the event of a crash.
       </para>
      </listitem>
     </varlistentry>

     <varlistentry>
      <term><option>-P <replaceable>plugin</replaceable></option></term>
      <term><option>--plugin=<replaceable>plugin</replaceable></option></term>

Changes to src/backend/replication/libpqwalreceiver/libpqwalreceiver.c

135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
	{
		int			ntuples = PQntuples(res);
		int			nfields = PQnfields(res);

		PQclear(res);
		ereport(ERROR,
				(errmsg("invalid response from primary server"),
				 errdetail("Could not identify system: Got %d rows and %d fields, expected %d rows and %d or more fields.",
						   ntuples, nfields, 3, 1)));
	}
	primary_sysid = PQgetvalue(res, 0, 0);
	*primary_tli = pg_atoi(PQgetvalue(res, 0, 1), 4, 0);

	/*
	 * Confirm that the system identifier of the primary is the same as ours.







|







135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
	{
		int			ntuples = PQntuples(res);
		int			nfields = PQnfields(res);

		PQclear(res);
		ereport(ERROR,
				(errmsg("invalid response from primary server"),
				 errdetail("Could not identify system: got %d rows and %d fields, expected %d rows and %d or more fields.",
						   ntuples, nfields, 3, 1)));
	}
	primary_sysid = PQgetvalue(res, 0, 0);
	*primary_tli = pg_atoi(PQgetvalue(res, 0, 1), 4, 0);

	/*
	 * Confirm that the system identifier of the primary is the same as ours.

Changes to src/bin/pg_basebackup/pg_basebackup.c

183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
...
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
	 * This check isn't absolutely necessary.  But all tablespaces are created
	 * with absolute directories, so specifying a non-absolute path here would
	 * just never match, possibly confusing users.  It's also good to be
	 * consistent with the new_dir check.
	 */
	if (!is_absolute_path(cell->old_dir))
	{
		fprintf(stderr, _("%s: old directory not absolute in tablespace mapping: %s\n"),
				progname, cell->old_dir);
		exit(1);
	}

	if (!is_absolute_path(cell->new_dir))
	{
		fprintf(stderr, _("%s: new directory not absolute in tablespace mapping: %s\n"),
				progname, cell->new_dir);
		exit(1);
	}

	if (tablespace_dirs.tail)
		tablespace_dirs.tail->next = cell;
	else
................................................................................
	/* The rest can only consist of white space. */
	while (*after_num != '\0' && isspace((unsigned char) *after_num))
		after_num++;

	if (*after_num != '\0')
	{
		fprintf(stderr,
				_("%s: invalid --max-rate units: \"%s\"\n"),
				progname, suffix);
		exit(1);
	}

	/* Valid integer? */
	if ((uint64) result != (uint64) ((uint32) result))
	{







|






|







 







|







183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
...
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
	 * This check isn't absolutely necessary.  But all tablespaces are created
	 * with absolute directories, so specifying a non-absolute path here would
	 * just never match, possibly confusing users.  It's also good to be
	 * consistent with the new_dir check.
	 */
	if (!is_absolute_path(cell->old_dir))
	{
		fprintf(stderr, _("%s: old directory is not an absolute path in tablespace mapping: %s\n"),
				progname, cell->old_dir);
		exit(1);
	}

	if (!is_absolute_path(cell->new_dir))
	{
		fprintf(stderr, _("%s: new directory is not an absolute path in tablespace mapping: %s\n"),
				progname, cell->new_dir);
		exit(1);
	}

	if (tablespace_dirs.tail)
		tablespace_dirs.tail->next = cell;
	else
................................................................................
	/* The rest can only consist of white space. */
	while (*after_num != '\0' && isspace((unsigned char) *after_num))
		after_num++;

	if (*after_num != '\0')
	{
		fprintf(stderr,
				_("%s: invalid --max-rate unit: \"%s\"\n"),
				progname, suffix);
		exit(1);
	}

	/* Valid integer? */
	if ((uint64) result != (uint64) ((uint32) result))
	{

Changes to src/bin/pg_basebackup/pg_recvlogical.c

76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
...
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
...
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
...
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
...
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
...
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
	printf(_("  -d, --dbname=DBNAME    database to connect to\n"));
	printf(_("  -h, --host=HOSTNAME    database server host or socket directory\n"));
	printf(_("  -p, --port=PORT        database server port number\n"));
	printf(_("  -U, --username=NAME    connect as specified database user\n"));
	printf(_("  -w, --no-password      never prompt for password\n"));
	printf(_("  -W, --password         force password prompt (should happen automatically)\n"));
	printf(_("\nReplication options:\n"));
	printf(_("  -F  --fsync-interval=INTERVAL\n"
			 "                         frequency of syncs to the output file (in seconds, defaults to 10)\n"));
	printf(_("  -o, --option=NAME[=VALUE]\n"
			 "                         Specify option NAME with optional value VALUE, to be passed\n"
			 "                         to the output plugin\n"));
	printf(_("  -P, --plugin=PLUGIN    use output plugin PLUGIN (defaults to test_decoding)\n"));
	printf(_("  -s, --status-interval=INTERVAL\n"
			 "                         time between status packets sent to server (in seconds, defaults to 10)\n"));
	printf(_("  -S, --slot=SLOT        use existing replication slot SLOT instead of starting a new one\n"));
	printf(_("  -I, --startpos=PTR     Where in an existing slot should the streaming start\n"));
	printf(_("\nAction to be performed:\n"));
	printf(_("      --create           create a new replication slot (for the slotname see --slot)\n"));
	printf(_("      --start            start streaming in a replication slot (for the slotname see --slot)\n"));
	printf(_("      --drop             drop the replication slot (for the slotname see --slot)\n"));
	printf(_("\nReport bugs to <pgsql-bugs@postgresql.org>.\n"));
................................................................................

	if (noptions)
		appendPQExpBufferChar(query, ')');

	res = PQexec(conn, query->data);
	if (PQresultStatus(res) != PGRES_COPY_BOTH)
	{
		fprintf(stderr, _("%s: could not send replication command \"%s\": %s\n"),
				progname, query->data, PQresultErrorMessage(res));
		PQclear(res);
		goto error;
	}
	PQclear(res);
	resetPQExpBuffer(query);

	if (verbose)
		fprintf(stderr,
				_("%s: initiated streaming\n"),
				progname);

	while (!time_to_abort)
	{
		int			r;
		int			bytes_left;
		int			bytes_written;
................................................................................
		fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
				progname);
		exit(1);
	}

	if (do_drop_slot && (do_create_slot || do_start_slot))
	{
		fprintf(stderr, _("%s: --stop cannot be combined with --init or --start\n"), progname);
		fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
				progname);
		exit(1);
	}

	if (startpos && (do_create_slot || do_drop_slot))
	{
		fprintf(stderr, _("%s: --startpos cannot be combined with --init or --stop\n"), progname);
		fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
				progname);
		exit(1);
	}

#ifndef WIN32
	pqsignal(SIGINT, sigint_handler);
................................................................................
					progname, query, PQerrorMessage(conn));
			disconnect_and_exit(1);
		}

		if (PQntuples(res) != 0 || PQnfields(res) != 0)
		{
			fprintf(stderr,
					_("%s: could not stop logical rep: got %d rows and %d fields, expected %d rows and %d fields\n"),
					progname, PQntuples(res), PQnfields(res), 0, 0);
			disconnect_and_exit(1);
		}

		PQclear(res);
		disconnect_and_exit(0);
	}
................................................................................
					progname, query, PQerrorMessage(conn));
			disconnect_and_exit(1);
		}

		if (PQntuples(res) != 1 || PQnfields(res) != 4)
		{
			fprintf(stderr,
					_("%s: could not init logical rep: got %d rows and %d fields, expected %d rows and %d fields\n"),
					progname, PQntuples(res), PQnfields(res), 1, 4);
			disconnect_and_exit(1);
		}

		if (sscanf(PQgetvalue(res, 0, 1), "%X/%X", &hi, &lo) != 2)
		{
			fprintf(stderr,
................................................................................
			 * We've been Ctrl-C'ed. That's not an error, so exit without an
			 * errorcode.
			 */
			disconnect_and_exit(0);
		}
		else if (noloop)
		{
			fprintf(stderr, _("%s: disconnected.\n"), progname);
			exit(1);
		}
		else
		{
			fprintf(stderr,
			/* translator: check source for value for %d */
					_("%s: disconnected. Waiting %d seconds to try again.\n"),
					progname, RECONNECT_SLEEP_TIME);
			pg_usleep(RECONNECT_SLEEP_TIME * 1000000);
		}
	}
}







|
|



|
|
|







 







|









|







 







|







|







 







|







 







|







 







|






|





76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
...
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
...
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
...
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
...
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
...
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
	printf(_("  -d, --dbname=DBNAME    database to connect to\n"));
	printf(_("  -h, --host=HOSTNAME    database server host or socket directory\n"));
	printf(_("  -p, --port=PORT        database server port number\n"));
	printf(_("  -U, --username=NAME    connect as specified database user\n"));
	printf(_("  -w, --no-password      never prompt for password\n"));
	printf(_("  -W, --password         force password prompt (should happen automatically)\n"));
	printf(_("\nReplication options:\n"));
	printf(_("  -F  --fsync-interval=SECS\n"
			 "                         frequency of syncs to the output file (default: %d)\n"), (fsync_interval / 1000));
	printf(_("  -o, --option=NAME[=VALUE]\n"
			 "                         Specify option NAME with optional value VALUE, to be passed\n"
			 "                         to the output plugin\n"));
	printf(_("  -P, --plugin=PLUGIN    use output plugin PLUGIN (default: %s)\n"), plugin);
	printf(_("  -s, --status-interval=SECS\n"
			 "                         time between status packets sent to server (default: %d)\n"), (standby_message_timeout / 1000));
	printf(_("  -S, --slot=SLOT        use existing replication slot SLOT instead of starting a new one\n"));
	printf(_("  -I, --startpos=PTR     Where in an existing slot should the streaming start\n"));
	printf(_("\nAction to be performed:\n"));
	printf(_("      --create           create a new replication slot (for the slotname see --slot)\n"));
	printf(_("      --start            start streaming in a replication slot (for the slotname see --slot)\n"));
	printf(_("      --drop             drop the replication slot (for the slotname see --slot)\n"));
	printf(_("\nReport bugs to <pgsql-bugs@postgresql.org>.\n"));
................................................................................

	if (noptions)
		appendPQExpBufferChar(query, ')');

	res = PQexec(conn, query->data);
	if (PQresultStatus(res) != PGRES_COPY_BOTH)
	{
		fprintf(stderr, _("%s: could not send replication command \"%s\": %s"),
				progname, query->data, PQresultErrorMessage(res));
		PQclear(res);
		goto error;
	}
	PQclear(res);
	resetPQExpBuffer(query);

	if (verbose)
		fprintf(stderr,
				_("%s: streaming initiated\n"),
				progname);

	while (!time_to_abort)
	{
		int			r;
		int			bytes_left;
		int			bytes_written;
................................................................................
		fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
				progname);
		exit(1);
	}

	if (do_drop_slot && (do_create_slot || do_start_slot))
	{
		fprintf(stderr, _("%s: cannot use --init or --start together with --stop\n"), progname);
		fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
				progname);
		exit(1);
	}

	if (startpos && (do_create_slot || do_drop_slot))
	{
		fprintf(stderr, _("%s: cannot use --init or --stop together with --startpos\n"), progname);
		fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
				progname);
		exit(1);
	}

#ifndef WIN32
	pqsignal(SIGINT, sigint_handler);
................................................................................
					progname, query, PQerrorMessage(conn));
			disconnect_and_exit(1);
		}

		if (PQntuples(res) != 0 || PQnfields(res) != 0)
		{
			fprintf(stderr,
					_("%s: could not stop logical replication: got %d rows and %d fields, expected %d rows and %d fields\n"),
					progname, PQntuples(res), PQnfields(res), 0, 0);
			disconnect_and_exit(1);
		}

		PQclear(res);
		disconnect_and_exit(0);
	}
................................................................................
					progname, query, PQerrorMessage(conn));
			disconnect_and_exit(1);
		}

		if (PQntuples(res) != 1 || PQnfields(res) != 4)
		{
			fprintf(stderr,
					_("%s: could not init logical replication: got %d rows and %d fields, expected %d rows and %d fields\n"),
					progname, PQntuples(res), PQnfields(res), 1, 4);
			disconnect_and_exit(1);
		}

		if (sscanf(PQgetvalue(res, 0, 1), "%X/%X", &hi, &lo) != 2)
		{
			fprintf(stderr,
................................................................................
			 * We've been Ctrl-C'ed. That's not an error, so exit without an
			 * errorcode.
			 */
			disconnect_and_exit(0);
		}
		else if (noloop)
		{
			fprintf(stderr, _("%s: disconnected\n"), progname);
			exit(1);
		}
		else
		{
			fprintf(stderr,
			/* translator: check source for value for %d */
					_("%s: disconnected; waiting %d seconds to try again\n"),
					progname, RECONNECT_SLEEP_TIME);
			pg_usleep(RECONNECT_SLEEP_TIME * 1000000);
		}
	}
}

Changes to src/bin/psql/command.c

2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
....
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
	else if (strcmp(param, "pager") == 0)
	{
		if (popt->topt.pager == 1)
			printf(_("Pager (%s) is used for long output.\n"), param);
		else if (popt->topt.pager == 2)
			printf(_("Pager (%s) is always used.\n"), param);
		else
			printf(_("Pager (%s) usage is off.\n"), param);
	}

	/* show record separator for unaligned text */
	else if (strcmp(param, "recordsep") == 0)
	{
		if (popt->topt.recordSep.separator_zero)
			printf(_("Record separator (%s) is zero byte.\n"), param);
................................................................................
		printf(_("Record separator (%s) is zero byte.\n"), param);
	}

	/* show HTML table tag options */
	else if (strcmp(param, "T") == 0 || strcmp(param, "tableattr") == 0)
	{
		if (popt->topt.tableAttr)
			printf(_("Table attribute (%s) is \"%s\".\n"), param,
				   popt->topt.tableAttr);
		else
			printf(_("Table attributes (%s) unset.\n"), param);
	}

	/* show title override */
	else if (strcmp(param, "title") == 0)







|







 







|







2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
....
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
	else if (strcmp(param, "pager") == 0)
	{
		if (popt->topt.pager == 1)
			printf(_("Pager (%s) is used for long output.\n"), param);
		else if (popt->topt.pager == 2)
			printf(_("Pager (%s) is always used.\n"), param);
		else
			printf(_("Pager usage (%s) is off.\n"), param);
	}

	/* show record separator for unaligned text */
	else if (strcmp(param, "recordsep") == 0)
	{
		if (popt->topt.recordSep.separator_zero)
			printf(_("Record separator (%s) is zero byte.\n"), param);
................................................................................
		printf(_("Record separator (%s) is zero byte.\n"), param);
	}

	/* show HTML table tag options */
	else if (strcmp(param, "T") == 0 || strcmp(param, "tableattr") == 0)
	{
		if (popt->topt.tableAttr)
			printf(_("Table attributes (%s) are \"%s\".\n"), param,
				   popt->topt.tableAttr);
		else
			printf(_("Table attributes (%s) unset.\n"), param);
	}

	/* show title override */
	else if (strcmp(param, "title") == 0)