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

Commita0fb391

Browse files
committed
Add support postgres 9.6.
1 parent0fa7e2f commita0fb391

File tree

3 files changed

+69
-2
lines changed

3 files changed

+69
-2
lines changed

‎Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ OBJS = backup.o \
2121
pgut/pgut.o\
2222
pgut/pgut-port.o
2323

24-
EXTRA_CLEAN = datapagemap.c datapagemap.h xlogreader.c receivelog.h streamutil.h
24+
EXTRA_CLEAN = datapagemap.c datapagemap.h xlogreader.c receivelog.h streamutil.h logging.h
2525

2626
PG_CPPFLAGS = -I$(libpq_srcdir) ${PTHREAD_CFLAGS}
2727
overrideCPPFLAGS := -DFRONTEND$(CPPFLAGS)
2828
PG_LIBS =$(libpq_pgport) ${PTHREAD_LIBS} ${PTHREAD_CFLAGS}
2929

3030
REGRESS = init option show delete backup restore
3131

32-
all: checksrcdir datapagemap.h receivelog.h streamutil.h pg_arman
32+
all: checksrcdir datapagemap.hlogging.hreceivelog.h streamutil.h pg_arman
3333

3434
# This rule's only purpose is to give the user instructions on how to pass
3535
# the path to PostgreSQL source tree to the makefile.
@@ -49,6 +49,10 @@ datapagemap.c: % : $(top_srcdir)/src/bin/pg_rewind/%
4949
rm -f$@&&$(LN_S)$<.
5050
datapagemap.h:% :$(top_srcdir)/src/bin/pg_rewind/%
5151
rm -f&&$(LN_S)$<.
52+
#logging.c: % : $(top_srcdir)/src/bin/pg_rewind/%
53+
#rm -f && $(LN_S) $< .
54+
logging.h:% :$(top_srcdir)/src/bin/pg_rewind/%
55+
rm -f&&$(LN_S)$<.
5256
receivelog.c:% :$(top_srcdir)/src/bin/pg_basebackup/%
5357
rm -f&&$(LN_S)$<.
5458
receivelog.h:% :$(top_srcdir)/src/bin/pg_basebackup/%

‎backup.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,9 +1326,23 @@ StreamLog(void *arg)
13261326
progname, (uint32) (startpos >>32), (uint32)startpos,
13271327
starttli);
13281328

1329+
#ifPG_VERSION_NUM >=90600
1330+
StreamCtlctl;
1331+
ctl.startpos=startpos;
1332+
ctl.timeline=starttli;
1333+
ctl.sysidentifier=NULL;
1334+
ctl.basedir=basedir;
1335+
ctl.stream_stop=stop_streaming;
1336+
ctl.standby_message_timeout=standby_message_timeout;
1337+
ctl.partial_suffix=".partial";
1338+
ctl.synchronous= false;
1339+
ctl.mark_done= false;
1340+
ReceiveXlogStream(conn,&ctl);
1341+
#else
13291342
ReceiveXlogStream(conn,startpos,starttli,NULL,basedir,
13301343
stop_streaming,standby_message_timeout,".partial",
13311344
false, false);
1345+
#endif
13321346

13331347
PQfinish(conn);
13341348
conn=NULL;

‎pgut/pgut.c

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ static boolin_cleanup = false;
5050

5151
staticboolparse_pair(constcharbuffer[],charkey[],charvalue[]);
5252

53+
typedefenum
54+
{
55+
PG_DEBUG,
56+
PG_PROGRESS,
57+
PG_WARNING,
58+
PG_FATAL
59+
}eLogType;
60+
61+
voidpg_log(eLogTypetype,constchar*fmt,...)pg_attribute_printf(2,3);
62+
5363
/* Connection routines */
5464
staticvoidinit_cancel_handler(void);
5565
staticvoidon_before_exec(PGconn*conn);
@@ -1202,6 +1212,45 @@ elog(int elevel, const char *fmt, ...)
12021212
exit_or_abort(elevel);
12031213
}
12041214

1215+
voidpg_log(eLogTypetype,constchar*fmt, ...)
1216+
{
1217+
va_listargs;
1218+
1219+
if (!verbose&&type <=PG_PROGRESS)
1220+
return;
1221+
if (quiet&&type<PG_WARNING)
1222+
return;
1223+
1224+
switch (type)
1225+
{
1226+
casePG_DEBUG:
1227+
fputs("DEBUG: ",stderr);
1228+
break;
1229+
casePG_PROGRESS:
1230+
fputs("PROGRESS: ",stderr);
1231+
break;
1232+
casePG_WARNING:
1233+
fputs("WARNING: ",stderr);
1234+
break;
1235+
casePG_FATAL:
1236+
fputs("FATAL: ",stderr);
1237+
break;
1238+
default:
1239+
if (type >=PG_FATAL)
1240+
fputs("ERROR: ",stderr);
1241+
break;
1242+
}
1243+
1244+
va_start(args,fmt);
1245+
vfprintf(stderr,fmt,args);
1246+
fputc('\n',stderr);
1247+
fflush(stderr);
1248+
va_end(args);
1249+
1250+
if (type>0)
1251+
exit_or_abort(type);
1252+
}
1253+
12051254
#ifdefWIN32
12061255
staticCRITICAL_SECTIONcancelConnLock;
12071256
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp