mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
Make the streaming replication protocol messages architecture-independent.
We used to send structs wrapped in CopyData messages, which works as long as the client and server agree on things like endianess, timestamp format and alignment. That's good enough for running a standby server, which has to run on the same platform anyway, but it's useful for tools like pg_receivexlog to work across platforms. This breaks protocol compatibility of streaming replication, but we never promised that to be compatible across versions, anyway.
This commit is contained in:
@@ -206,13 +206,24 @@ extern Datum generate_series_timestamptz(PG_FUNCTION_ARGS);
|
||||
/* Internal routines (not fmgr-callable) */
|
||||
|
||||
extern TimestampTz GetCurrentTimestamp(void);
|
||||
|
||||
extern void TimestampDifference(TimestampTz start_time, TimestampTz stop_time,
|
||||
long *secs, int *microsecs);
|
||||
extern bool TimestampDifferenceExceeds(TimestampTz start_time,
|
||||
TimestampTz stop_time,
|
||||
int msec);
|
||||
|
||||
/*
|
||||
* Prototypes for functions to deal with integer timestamps, when the native
|
||||
* format is float timestamps.
|
||||
*/
|
||||
#ifndef HAVE_INT64_TIMESTAMP
|
||||
extern int64 GetCurrentIntegerTimestamp(void);
|
||||
extern TimestampTz IntegerTimestampToTimestampTz(int64 timestamp);
|
||||
#else
|
||||
#define GetCurrentIntegerTimestamp() GetCurrentTimestamp()
|
||||
#define IntegerTimestampToTimestampTz(timestamp) (timestamp)
|
||||
#endif
|
||||
|
||||
extern TimestampTz time_t_to_timestamptz(pg_time_t tm);
|
||||
extern pg_time_t timestamptz_to_time_t(TimestampTz t);
|
||||
|
||||
|
Reference in New Issue
Block a user