Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,25 @@ is_cfm_file_path(const char *filepath) {
off_t
get_cfs_relation_file_decompressed_size(RelFileNodeBackend rnode, const char *fullpath, ForkNumber forknum) {
File fd;
int compressor;
off_t size;

#if PG_VERSION_NUM >= 120000
int compressor;
compressor = md_get_compressor_internal(nodeOf(rnode), rnode.backend, forknum);
fd = PathNameOpenFile(fullpath, O_RDWR | PG_BINARY, compressor);
#else
fd = PathNameOpenFile(fullpath, O_RDWR | PG_BINARY | PG_COMPRESSION);
#endif

if(fd < 0)
return (off_t)-1;

#if PG_VERSION_NUM >= 120000
size = FileSize(fd);
#else
size = FileSeek(fd, 0, SEEK_END);
#endif

FileClose(fd);

return size;
Expand Down
2 changes: 1 addition & 1 deletion engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#define PTRACK_MAGIC_SIZE 4

/* CFS support macro */
#if defined(PGPRO_EE) && PG_VERSION_NUM >= 120000
#if defined(PGPRO_EE) && PG_VERSION_NUM >= 110000
#define CFS_SUPPORT 1
#endif

Expand Down
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