Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit304aa33

Browse files
committed
Prevent pg_basebackup when integer_datetimes flag doesn't match.
Magnus Hagander, reviewed by Fujii Masao, with slight wording changesby me.
1 parent219c024 commit304aa33

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

‎src/bin/pg_basebackup/streamutil.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ GetConnection(void)
7575
constchar**keywords;
7676
constchar**values;
7777
char*password=NULL;
78+
constchar*tmpparam;
7879

7980
if (dbhost)
8081
argcount++;
@@ -157,6 +158,29 @@ GetConnection(void)
157158
free(values);
158159
free(keywords);
159160

161+
/*
162+
* Ensure we have the same value of integer timestamps as the
163+
* server we are connecting to.
164+
*/
165+
tmpparam=PQparameterStatus(tmpconn,"integer_datetimes");
166+
if (!tmpparam)
167+
{
168+
fprintf(stderr,_("%s: could not determine server setting for integer_datetimes\n"),
169+
progname);
170+
exit(1);
171+
}
172+
173+
#ifdefHAVE_INT64_TIMESTAMP
174+
if (strcmp(tmpparam,"on")!=0)
175+
#else
176+
if (strcmp(tmpparam,"off")!=0)
177+
#endif
178+
{
179+
fprintf(stderr,_("%s: integer_datetimes compile flag does not match server\n"),
180+
progname);
181+
exit(1);
182+
}
183+
160184
/* Store the password for next run */
161185
if (password)
162186
dbpassword=password;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp