Skip to content
Open
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
3 changes: 3 additions & 0 deletions methods/array_ops/src/pg_gp/array_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
#else
#include "utils/int8.h"
#endif
#if PG_VERSION_NUM >= 160000
#include <varatt.h>
#endif
#include "utils/datum.h"
#include "utils/lsyscache.h"
#include "utils/typcache.h"
Expand Down
3 changes: 3 additions & 0 deletions methods/kmeans/src/pg_gp/kmeans.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#else
#include <utils/builtins.h>
#endif
#if PG_VERSION_NUM >= 160000
#include <varatt.h>
#endif
#include <utils/memutils.h>
#include <math.h>
#include "../../../svec/src/pg_gp/sparse_vector.h"
Expand Down
3 changes: 3 additions & 0 deletions methods/sketch/src/pg_gp/countmin.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
#include <nodes/execnodes.h>
#include <fmgr.h>
#include <catalog/pg_type.h>
#if PG_VERSION_NUM >= 160000
#include <varatt.h>
#endif
#include <ctype.h>
#include "sketch_support.h"
#include "countmin.h"
Expand Down
5 changes: 4 additions & 1 deletion methods/sketch/src/pg_gp/fm.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
#else
#include <libpq/md5.h>
#endif
#if PG_VERSION_NUM >= 160000
#include <varatt.h>
#endif
#include <nodes/execnodes.h>
#include <fmgr.h>
#include <ctype.h>
Expand Down Expand Up @@ -592,7 +595,7 @@ bytea *fmsketch_sortasort_insert(bytea *transblob, Datum dat, size_t len)
sortasort *s_in =
(sortasort *)(transval->storage);
bytea * newblob;
bool success = false;
int success = 0;
size_t new_storage_sz;
size_t newsize;

Expand Down
3 changes: 3 additions & 0 deletions methods/sketch/src/pg_gp/mfvsketch.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
#include <utils/elog.h>
#include <utils/builtins.h>
#include <utils/lsyscache.h>
#if PG_VERSION_NUM >= 160000
#include <varatt.h>
#endif
#include <utils/numeric.h>
#include <utils/typcache.h>
#include <utils/datum.h>
Expand Down
3 changes: 3 additions & 0 deletions methods/sketch/src/pg_gp/sketch_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
#else
#include <libpq/md5.h>
#endif
#if PG_VERSION_NUM >= 160000
#include <varatt.h>
#endif
#include <utils/lsyscache.h>
#include "sketch_support.h"

Expand Down
3 changes: 3 additions & 0 deletions methods/svec/src/pg_gp/sparse_vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
#include "utils/fmgroids.h"
#include "lib/stringinfo.h"
#include "utils/memutils.h"
#if PG_VERSION_NUM >= 160000
#include <varatt.h>
#endif
#include "sparse_vector.h"

/**
Expand Down
21 changes: 21 additions & 0 deletions src/ports/postgres/16/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ------------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ------------------------------------------------------------------------------

add_current_postgresql_version()
add_extension_support()
21 changes: 21 additions & 0 deletions src/ports/postgres/17/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ------------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ------------------------------------------------------------------------------

add_current_postgresql_version()
add_extension_support()
21 changes: 21 additions & 0 deletions src/ports/postgres/18/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ------------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ------------------------------------------------------------------------------

add_current_postgresql_version()
add_extension_support()
21 changes: 21 additions & 0 deletions src/ports/postgres/cmake/FindPostgreSQL_16.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ------------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ------------------------------------------------------------------------------

set(_FIND_PACKAGE_FILE "${CMAKE_CURRENT_LIST_FILE}")
include("${CMAKE_CURRENT_LIST_DIR}/FindPostgreSQL.cmake")
21 changes: 21 additions & 0 deletions src/ports/postgres/cmake/FindPostgreSQL_17.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ------------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ------------------------------------------------------------------------------

set(_FIND_PACKAGE_FILE "${CMAKE_CURRENT_LIST_FILE}")
include("${CMAKE_CURRENT_LIST_DIR}/FindPostgreSQL.cmake")
21 changes: 21 additions & 0 deletions src/ports/postgres/cmake/FindPostgreSQL_18.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ------------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ------------------------------------------------------------------------------

set(_FIND_PACKAGE_FILE "${CMAKE_CURRENT_LIST_FILE}")
include("${CMAKE_CURRENT_LIST_DIR}/FindPostgreSQL.cmake")
11 changes: 11 additions & 0 deletions src/ports/postgres/dbconnector/Backend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,20 @@ namespace {
MADLIB_WRAP_PG_FUNC(
bool, type_is_array, (Oid typid), (typid))

// PostgreSQL 16+ replaced pg_proc_aclcheck with object_aclcheck
#if PG_VERSION_NUM >= 160000
MADLIB_WRAP_PG_FUNC(
AclResult, object_aclcheck, (Oid classid, Oid objectid, Oid roleid, AclMode mode),
(classid, objectid, roleid, mode))

inline AclResult madlib_pg_proc_aclcheck(Oid proc_oid, Oid roleid, AclMode mode) {
return madlib_object_aclcheck(ProcedureRelationId, proc_oid, roleid, mode);
}
#else
MADLIB_WRAP_PG_FUNC(
AclResult, pg_proc_aclcheck, (Oid proc_oid, Oid roleid, AclMode mode),
(proc_oid, roleid, mode))
#endif

MADLIB_WRAP_PG_FUNC(
void*, MemoryContextAlloc, (MemoryContext context, Size size),
Expand Down
6 changes: 6 additions & 0 deletions src/ports/postgres/dbconnector/Compatibility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ extern "C" {
#if PG_VERSION_NUM >= 90300
#include <access/htup_details.h>
#endif

// PostgreSQL 16+ compatibility
#if PG_VERSION_NUM >= 160000
#include <varatt.h>
#include <catalog/pg_proc.h>
#endif
}


Expand Down
31 changes: 22 additions & 9 deletions tool/docker/base/Dockerfile_postgres_15_Jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,31 @@
# specific language governing permissions and limitations
# under the License.

FROM gcr.io/data-gpdb-public-images/gpdb7-ubuntu20.04-test
FROM ubuntu:22.04

# Argument for configuring the timezone
ARG TIMEZONE_VAR="Europe/London"
ENV TZ=${TIMEZONE_VAR}
ENV DEBIAN_FRONTEND=noninteractive

# Set the LOCALE
ENV LANG=en_US.UTF-8
RUN apt-get update && apt-get install -y locales && \
locale-gen en_US.UTF-8 && \
update-locale LANG=en_US.UTF-8 && \
apt-get clean && rm -rf /var/lib/apt/lists/*

### Get postgres specific add-ons
RUN apt-get update && apt-get install -y wget \
RUN apt-get update && apt-get install -y wget \
build-essential \
openssl \
libssl-dev \
lsb-release \
libboost-all-dev \
m4 \
rpm \
python3-pip \
python3-dev \
build-essential \
cmake \
libspatialindex-dev \
vim \
Expand All @@ -41,21 +53,22 @@ RUN apt-get update && apt-get install -y wget \
iputils-ping \
iproute2 \
net-tools \
libspatialindex-dev \
ca-certificates
ca-certificates && \
apt-get clean && rm -rf /var/lib/apt/lists/*

RUN add-apt-repository -y ppa:deadsnakes/ppa
RUN echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list

RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
RUN apt-get update && apt-get install -y \
postgresql-server-dev-15 \
postgresql-plpython3-15 \
postgresql-15 \
postgresql-client-15 \
libpq-dev

libpq-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
RUN python3 -m pip install dill rtree xgboost mock pandas numpy scikit-learn pyxb-x

## To build an image from this docker file, from madlib folder, run:
# docker build -t madlib/postgres_15:jenkins -f tool/docker/base/Dockerfile_postgres_15_Jenkins .
# docker build -t madlib/postgres_15:jenkins -f tool/docker/base/Dockerfile_postgres_15_Jenkins .
74 changes: 74 additions & 0 deletions tool/docker/base/Dockerfile_postgres_16_Jenkins
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

FROM ubuntu:22.04

# Argument for configuring the timezone
ARG TIMEZONE_VAR="Europe/London"
ENV TZ=${TIMEZONE_VAR}
ENV DEBIAN_FRONTEND=noninteractive

# Set the LOCALE
ENV LANG=en_US.UTF-8
RUN apt-get update && apt-get install -y locales && \
locale-gen en_US.UTF-8 && \
update-locale LANG=en_US.UTF-8 && \
apt-get clean && rm -rf /var/lib/apt/lists/*

### Get postgres specific add-ons
RUN apt-get update && apt-get install -y wget \
build-essential \
openssl \
libssl-dev \
lsb-release \
libboost-all-dev \
m4 \
rpm \
python3-pip \
python3-dev \
cmake \
libspatialindex-dev \
vim \
sudo \
software-properties-common \
lsb-core \
libyaml-dev \
libpython3-dev \
python3-distutils \
iputils-ping \
iproute2 \
net-tools \
ca-certificates && \
apt-get clean && rm -rf /var/lib/apt/lists/*

RUN add-apt-repository -y ppa:deadsnakes/ppa
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list

RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
RUN apt-get update && apt-get install -y \
postgresql-server-dev-16 \
postgresql-plpython3-16 \
postgresql-16 \
postgresql-client-16 \
libpq-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
RUN python3 -m pip install dill rtree xgboost mock pandas numpy scikit-learn pyxb-x

## To build an image from this docker file, from madlib folder, run:
# docker build -t madlib/postgres_16:jenkins -f tool/docker/base/Dockerfile_postgres_16_Jenkins .
Loading