Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 3 additions & 4 deletions .github/workflows/pg-extension-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ on:
workflow_dispatch:
inputs:
pg_version:
description: "PostgreSQL version to build (16, 17, 18, or all)"
description: "PostgreSQL version to build (17, 18, or all)"
required: false
default: "18"
type: choice
options:
- "16"
- "17"
- "18"
- all
Expand Down Expand Up @@ -50,8 +49,8 @@ jobs:
id: set-versions
run: |-
if [ "${PG_VERSION}" == "all" ]; then
echo "versions=[\"16\",\"17\",\"18\"]" >> "${GITHUB_OUTPUT}"
echo "versions-list=16,17,18" >> "${GITHUB_OUTPUT}"
echo "versions=[\"17\",\"18\"]" >> "${GITHUB_OUTPUT}"
echo "versions-list=17,18" >> "${GITHUB_OUTPUT}"
else
echo "versions=[\"${PG_VERSION}\"]" >> "${GITHUB_OUTPUT}"
echo "versions-list=${PG_VERSION}" >> "${GITHUB_OUTPUT}"
Expand Down
5 changes: 0 additions & 5 deletions cpp/CMakeLists.pg.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
option(BUILD_PG_16 "Build PostgreSQL 16 extension" OFF)
option(BUILD_PG_17 "Build PostgreSQL 17 extension" OFF)
option(BUILD_PG_18 "Build PostgreSQL 18 extension" ON)
option(USE_DEEPLAKE_SHARED "Use shared library for deeplake_api (default: auto-detect)" OFF)

set(PG_MODULE deeplake_pg)
set(PG_VERSIONS)

if(BUILD_PG_16)
list(APPEND PG_VERSIONS 16)
endif()

if(BUILD_PG_17)
list(APPEND PG_VERSIONS 17)
endif()
Expand Down
3 changes: 0 additions & 3 deletions cpp/cmake/modules/FindPostgres.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ include(ExternalProject)

# Define PostgreSQL versions
set(postgres_versions
"REL_16_0"
"REL_17_0"
"REL_18_0"
)

# Define corresponding SHA256 checksums for each version
set(postgres_SHA256_CHECKSUMS
"37851d1fdae1f2cdd1d23bf9a4598b6c2f3f6792e18bc974d78ed780a28933bf"
"16912fe4aef3c8f297b5da1b591741f132377c8b5e1b8e896e07fdd680d6bf34"
"b155bd4a467b401ebe61b504643492aae2d0836981aa4a5a60f8668b94eadebc"
)
Expand Down Expand Up @@ -47,6 +45,5 @@ foreach(postgres_version IN LISTS postgres_versions)
)
endforeach()

set(postgres_INSTALL_DIR_REL_16_0 ${DEFAULT_PARENT_DIR}/.ext/postgres-REL_16_0/install)
set(postgres_INSTALL_DIR_REL_17_0 ${DEFAULT_PARENT_DIR}/.ext/postgres-REL_17_0/install)
set(postgres_INSTALL_DIR_REL_18_0 ${DEFAULT_PARENT_DIR}/.ext/postgres-REL_18_0/install)
1 change: 0 additions & 1 deletion cpp/deeplake_pg/pg_version_compat.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

#define PG_VERSION_NUM_16 160000
#define PG_VERSION_NUM_17 170000
#define PG_VERSION_NUM_18 180000

Expand Down
4 changes: 0 additions & 4 deletions cpp/deeplake_pg/table_am.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ bool deeplake_scan_analyze_next_tuple(
return true;
}

#if PG_VERSION_NUM >= PG_VERSION_NUM_17
bool deeplake_scan_analyze_next_block(TableScanDesc scan, ReadStream* stream)
{
DeeplakeScanData* scan_data = get_scan_data(scan);
Expand Down Expand Up @@ -349,7 +348,6 @@ bool deeplake_scan_analyze_next_block(TableScanDesc scan, ReadStream* stream)

return true; // Indicate we have data to process
}
#endif

double deeplake_index_build_range_scan(Relation heap_rel,
Relation index_rel,
Expand Down Expand Up @@ -657,9 +655,7 @@ void deeplake_table_am_routine::initialize()
routine.relation_size = deeplake_relation_size;
routine.relation_estimate_size = deeplake_estimate_rel_size;
routine.scan_analyze_next_tuple = deeplake_scan_analyze_next_tuple;
#if PG_VERSION_NUM >= PG_VERSION_NUM_17
routine.scan_analyze_next_block = deeplake_scan_analyze_next_block;
#endif

routine.parallelscan_initialize = parallelscan_initialize;
routine.parallelscan_estimate = parallelscan_estimate;
Expand Down
6 changes: 3 additions & 3 deletions postgres/scripts/build_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ usage() {
echo -e " repository: Repository directory path"
echo -e " architecture: amd64 or arm64"
echo -e " gpg-keyid: GPG key ID for signing"
echo -e " supported-versions: Comma-separated PostgreSQL versions (e.g., 16,17,18)"
echo -e " supported-versions: Comma-separated PostgreSQL versions (e.g., 17,18)"
echo -e "\nExamples:"
echo -e " bash $0 4.4.4-1 /tmp/repo arm64 1F8B584DBEA11E9D 16,17,18"
echo -e " bash $0 /tmp/repo arm64 1F8B584DBEA11E9D 16,17,18 # Auto-detect version"
echo -e " bash $0 4.4.4-1 /tmp/repo arm64 1F8B584DBEA11E9D 17,18"
echo -e " bash $0 /tmp/repo arm64 1F8B584DBEA11E9D 17,18 # Auto-detect version"
}

# Error handling function
Expand Down
4 changes: 2 additions & 2 deletions postgres/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ check_postgres() {
if command_exists psql; then
psql_version=$(psql -V | awk '{print $3}' | cut -d'.' -f1)
case "$psql_version" in
14 | 15 | 16 | 17)
17 | 18)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version check was changed from 14 | 15 | 16 | 17 to only 17 | 18, which drops support for PostgreSQL 14 and 15 in addition to 16. This seems like an unintended breaking change since the PR title only mentions removing PG 16 support.

If PostgreSQL 14 and 15 support should also be removed, this should be documented in the PR description and the title should reflect the broader scope.

log "PostgreSQL version $psql_version detected."
;;
*)
handle_error 1 "Unsupported PostgreSQL version: $psql_version. Only versions 14, 15, 16, and 17 are supported."
handle_error 1 "Unsupported PostgreSQL version: $psql_version. Only versions 17 and 18 are supported."
;;
esac
else
Expand Down
14 changes: 7 additions & 7 deletions scripts/build_pg_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
Usage: python3 scripts/build_pg_ext.py prod #Release build
Usage: python3 scripts/build_pg_ext.py debug --deeplake-shared #Debug build with shared deeplake_api linking
Usage: python3 scripts/build_pg_ext.py debug --deeplake-static #Debug build with static deeplake_api linking (force)
Usage: python3 scripts/build_pg_ext.py dev --pg-versions 16,17,18 #Build for PostgreSQL 16, 17, and 18
Usage: python3 scripts/build_pg_ext.py dev --pg-versions 16 #Build for PostgreSQL 16 only
Usage: python3 scripts/build_pg_ext.py dev --pg-versions 17,18 #Build for PostgreSQL 17 and 18
Usage: python3 scripts/build_pg_ext.py dev --pg-versions 17 #Build for PostgreSQL 17 only
Usage: python3 scripts/build_pg_ext.py prod --pg-versions all #Build for all supported PostgreSQL versions
"""

Expand Down Expand Up @@ -141,7 +141,7 @@ def run(mode: str, incremental: bool, deeplake_link_type: str = None, pg_version

# Add PostgreSQL version options if specified
if pg_versions is not None:
supported_versions = {16, 17, 18}
supported_versions = {17, 18}
# Set all versions to OFF by default
for ver in supported_versions:
if ver in pg_versions:
Expand Down Expand Up @@ -234,20 +234,20 @@ def write_mode(mode: str):
i += 1
elif arg == "--pg-versions":
if i + 1 >= len(sys.argv):
raise Exception("--pg-versions requires a value (e.g., '16,17,18' or 'all')")
raise Exception("--pg-versions requires a value (e.g., '17,18' or 'all')")
versions_str = sys.argv[i + 1]
if versions_str == "all":
pg_versions = [16, 17, 18]
pg_versions = [17, 18]
else:
try:
pg_versions = [int(v.strip()) for v in versions_str.split(',')]
# Validate versions
supported = {16, 17, 18}
supported = {17, 18}
invalid = set(pg_versions) - supported
if invalid:
raise Exception(f"Invalid PostgreSQL versions: {invalid}. Supported: {supported}")
except ValueError:
raise Exception(f"Invalid --pg-versions format: '{versions_str}'. Use comma-separated numbers (e.g., '16,17,18') or 'all'")
raise Exception(f"Invalid --pg-versions format: '{versions_str}'. Use comma-separated numbers (e.g., '17,18') or 'all'")
i += 2
else:
raise Exception(f"Invalid option '{arg}'. Use --deeplake-shared, --deeplake-static, or --pg-versions")
Expand Down
Loading