Skip to content

Commit 42ea77d

Browse files
daniel-95Daniel Shelepanov
andauthored
[PBKP-531] hotfix (#33)
[PBKP-531] hotfix PGPROEE11 now supports ptrack for CFS --------- Co-authored-by: Daniel Shelepanov <d.shelepanov@postgrespro.ru>
1 parent eab35bc commit 42ea77d

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

engine.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,25 @@ is_cfm_file_path(const char *filepath) {
117117
off_t
118118
get_cfs_relation_file_decompressed_size(RelFileNodeBackend rnode, const char *fullpath, ForkNumber forknum) {
119119
File fd;
120-
int compressor;
121120
off_t size;
122121

122+
#if PG_VERSION_NUM >= 120000
123+
int compressor;
123124
compressor = md_get_compressor_internal(nodeOf(rnode), rnode.backend, forknum);
124125
fd = PathNameOpenFile(fullpath, O_RDWR | PG_BINARY, compressor);
126+
#else
127+
fd = PathNameOpenFile(fullpath, O_RDWR | PG_BINARY | PG_COMPRESSION);
128+
#endif
125129

126130
if(fd < 0)
127131
return (off_t)-1;
128132

133+
#if PG_VERSION_NUM >= 120000
129134
size = FileSize(fd);
135+
#else
136+
size = FileSeek(fd, 0, SEEK_END);
137+
#endif
138+
130139
FileClose(fd);
131140

132141
return size;

engine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#define PTRACK_MAGIC_SIZE 4
4646

4747
/* CFS support macro */
48-
#if defined(PGPRO_EE) && PG_VERSION_NUM >= 120000
48+
#if defined(PGPRO_EE) && PG_VERSION_NUM >= 110000
4949
#define CFS_SUPPORT 1
5050
#endif
5151

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy