File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -43,14 +43,16 @@ buildPgrxExtension_0_12_9 rec {
43
43
POSTGRES_LIB = "${ postgresql } /lib" ;
44
44
RUSTFLAGS = "-C link-arg=-undefined -C link-arg=dynamic_lookup" ;
45
45
# Calculate unique port for each PostgreSQL version:
46
- # - Take first 2 chars of version (e.g., "15" from "15.8", "17" from "17.0" )
47
- # - Convert to number and subtract 15 to get offset
48
- # - Add to base port 5435
46
+ # - Check if version contains underscore (indicating OrioleDB )
47
+ # - Add 1 to port if it's OrioleDB
48
+ # - Add 2 for each major version above 15
49
49
# Examples:
50
- # - PostgreSQL 15.8 → 5435 + (15-15) = 5435
51
- # - PostgreSQL 17.0 → 5435 + (17-15) = 5437
52
- # - PostgreSQL 17.4 → 5435 + (17-15) = 5437
53
- PGPORT = toString ( 5435 + ( builtins . fromJSON ( builtins . substring 0 2 postgresql . version ) ) - 15 ) ;
50
+ # - PostgreSQL 15.8 → 5435 + 0 + (15-15)*2 = 5435
51
+ # - PostgreSQL 17_0 (OrioleDB) → 5435 + 1 + (17-15)*2 = 5440
52
+ # - PostgreSQL 17.4 → 5435 + 0 + (17-15)*2 = 5439
53
+ PGPORT = toString ( 5435 +
54
+ ( if builtins . match ".*_.*" postgresql . version != null then 1 else 0 ) + # +1 for OrioleDB
55
+ ( ( builtins . fromJSON ( builtins . substring 0 2 postgresql . version ) ) - 15 ) * 2 ) ; # +2 for each major version
54
56
} ;
55
57
56
58
OPENSSL_NO_VENDOR = 1 ;
You can’t perform that action at this time.
0 commit comments