pgsql: Install a check for mis-linking of src/port and src/common funct

2018-09-09 Thread Tom Lane
Install a check for mis-linking of src/port and src/common functions. On ELF-based platforms (and maybe others?) it's possible for a shared library, when dynamically loaded into the backend, to call the backend versions of src/port and src/common functions rather than the frontend versions that ar

pgsql: Work around stdbool problem in dfmgr.c.

2018-09-09 Thread Tom Lane
Work around stdbool problem in dfmgr.c. Commit 842cb9fa6 refactored things so that dfmgr.c includes , which before that had only been directly included in platform-specific stub files. It turns out that on macOS, includes , and that causes problems on platforms where _Bool is not char-sized ...

pgsql: Improve behavior of to_timestamp()/to_date() functions

2018-09-09 Thread Alexander Korotkov
Improve behavior of to_timestamp()/to_date() functions to_timestamp()/to_date() functions were introduced mainly for Oracle compatibility, and became very popular among PostgreSQL users. However, some behavior of to_timestamp()/to_date() functions are both incompatible with Oracle and confusing f

pgsql: Fix past pd_upper write in ginRedoRecompress()

2018-09-09 Thread Alexander Korotkov
Fix past pd_upper write in ginRedoRecompress() ginRedoRecompress() replays actions over compressed segments of posting list in-place. However, it might lead to write past pg_upper, because intermediate state during playing the changes can take more space than both original state and final state.

pgsql: Fix past pd_upper write in ginRedoRecompress()

2018-09-09 Thread Alexander Korotkov
Fix past pd_upper write in ginRedoRecompress() ginRedoRecompress() replays actions over compressed segments of posting list in-place. However, it might lead to write past pg_upper, because intermediate state during playing the changes can take more space than both original state and final state.

pgsql: Fix past pd_upper write in ginRedoRecompress()

2018-09-09 Thread Alexander Korotkov
Fix past pd_upper write in ginRedoRecompress() ginRedoRecompress() replays actions over compressed segments of posting list in-place. However, it might lead to write past pg_upper, because intermediate state during playing the changes can take more space than both original state and final state.

pgsql: Fix past pd_upper write in ginRedoRecompress()

2018-09-09 Thread Alexander Korotkov
Fix past pd_upper write in ginRedoRecompress() ginRedoRecompress() replays actions over compressed segments of posting list in-place. However, it might lead to write past pg_upper, because intermediate state during playing the changes can take more space than both original state and final state.

pgsql: Fix past pd_upper write in ginRedoRecompress()

2018-09-09 Thread Alexander Korotkov
Fix past pd_upper write in ginRedoRecompress() ginRedoRecompress() replays actions over compressed segments of posting list in-place. However, it might lead to write past pg_upper, because intermediate state during playing the changes can take more space than both original state and final state.

pgsql: Fix past pd_upper write in ginRedoRecompress()

2018-09-09 Thread Alexander Korotkov
Fix past pd_upper write in ginRedoRecompress() ginRedoRecompress() replays actions over compressed segments of posting list in-place. However, it might lead to write past pg_upper, because intermediate state during playing the changes can take more space than both original state and final state.

pgsql: Prevent mis-linking of src/port and src/common functions on *BSD

2018-09-09 Thread Tom Lane
Prevent mis-linking of src/port and src/common functions on *BSD. On ELF-based platforms (and maybe others?) it's possible for a shared library, when dynamically loaded into the backend, to call the backend versions of src/port and src/common functions rather than the frontend versions that are ac

pgsql: Prevent mis-linking of src/port and src/common functions on *BSD

2018-09-09 Thread Tom Lane
Prevent mis-linking of src/port and src/common functions on *BSD. On ELF-based platforms (and maybe others?) it's possible for a shared library, when dynamically loaded into the backend, to call the backend versions of src/port and src/common functions rather than the frontend versions that are ac

pgsql: Prevent mis-linking of src/port and src/common functions on *BSD

2018-09-09 Thread Tom Lane
Prevent mis-linking of src/port and src/common functions on *BSD. On ELF-based platforms (and maybe others?) it's possible for a shared library, when dynamically loaded into the backend, to call the backend versions of src/port and src/common functions rather than the frontend versions that are ac