Do not use the Postgresql server includes anymore to get datatypes id.

[CONFIGURATION]
* NEW: Update gitlab CI configuration file.

[GB.DB.POSTGRESQL]
* BUG: Do not use the Postgresql server includes anymore to get datatypes id.
  Read them directly from the database at connection. That way the component
  can compile again on new versions of Fedora that broke the Postgresql packages.
This commit is contained in:
gambas 2021-11-07 20:42:27 +01:00
parent 6e2140b1ed
commit 4b8b7a8dbd
3 changed files with 155 additions and 181 deletions

View file

@ -48,7 +48,7 @@ build:debian-oldstable:
- >
apt-get update && apt-get install -y build-essential g++ automake
autoconf libbz2-dev libzstd-dev default-libmysqlclient-dev unixodbc-dev libpq-dev
postgresql-server-dev-11 libsqlite0-dev libsqlite3-dev libglib2.0-dev
libsqlite0-dev libsqlite3-dev libglib2.0-dev
libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev
libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev
libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev
@ -74,7 +74,7 @@ build:debian-stable:
- >
apt-get update && apt-get install -y build-essential g++ automake
autoconf libbz2-dev libzstd-dev default-libmysqlclient-dev unixodbc-dev libpq-dev
postgresql-server-dev-13 libsqlite3-dev libglib2.0-dev
libsqlite3-dev libglib2.0-dev
libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev
libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev
libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev
@ -99,7 +99,7 @@ build:debian-testing:
- >
apt-get update && apt-get install -y build-essential g++ automake
autoconf libbz2-dev libzstd-dev default-libmysqlclient-dev unixodbc-dev libpq-dev
postgresql-server-dev-13 libsqlite3-dev libglib2.0-dev
libsqlite3-dev libglib2.0-dev
libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev
libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev
libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev
@ -123,7 +123,7 @@ build:debian-unstable:
image: debian:unstable
before_script:
- >
apt-get update && apt-get install -y build-essential g++ automake autoconf libbz2-dev libzstd-dev default-libmysqlclient-dev unixodbc-dev libpq-dev postgresql-server-dev-13 libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev libpoppler-private-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-3.0-dev libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev qtwebengine5-dev libwebkit2gtk-4.0-dev git libssl-dev
apt-get update && apt-get install -y build-essential g++ automake autoconf libbz2-dev libzstd-dev default-libmysqlclient-dev unixodbc-dev libpq-dev libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev libpoppler-private-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-3.0-dev libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev qtwebengine5-dev libwebkit2gtk-4.0-dev git libssl-dev
script:
- ./reconf-all
- GAMBAS_CONFIG_FAILURE=1 ./configure -C --disable-keyring --disable-qt4
@ -134,7 +134,7 @@ build:ubuntu-impish:
image: ubuntu:impish
before_script:
- >
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libzstd-dev libmysqlclient-dev unixodbc-dev libpq-dev postgresql-server-dev-13 libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-private-dev libpoppler-glib-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-3.0-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev qtwebengine5-dev libwebkit2gtk-4.0-dev git
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libzstd-dev libmysqlclient-dev unixodbc-dev libpq-dev libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-private-dev libpoppler-glib-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-3.0-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev qtwebengine5-dev libwebkit2gtk-4.0-dev git
script:
- ./reconf-all
@ -146,7 +146,7 @@ build:ubuntu-hirsute:
image: ubuntu:hirsute
before_script:
- >
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libzstd-dev libmysqlclient-dev unixodbc-dev libpq-dev postgresql-server-dev-13 libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-private-dev libpoppler-glib-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-3.0-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev qtwebengine5-dev libwebkit2gtk-4.0-dev git
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libzstd-dev libmysqlclient-dev unixodbc-dev libpq-dev libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-private-dev libpoppler-glib-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-3.0-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev qtwebengine5-dev libwebkit2gtk-4.0-dev git
script:
- ./reconf-all
@ -158,7 +158,7 @@ build:ubuntu-focal:
image: ubuntu:focal
before_script:
- >
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libzstd-dev libmysqlclient-dev unixodbc-dev libpq-dev postgresql-server-dev-12 libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-private-dev libpoppler-glib-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-2.6-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev qtwebengine5-dev libwebkit2gtk-4.0-dev git
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libzstd-dev libmysqlclient-dev unixodbc-dev libpq-dev libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-private-dev libpoppler-glib-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-2.6-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev qtwebengine5-dev libwebkit2gtk-4.0-dev git
script:
- ./reconf-all
@ -170,7 +170,7 @@ build:ubuntu-bionic:
image: ubuntu:bionic
before_script:
- >
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libzstd-dev libmysqlclient-dev unixodbc-dev libpq-dev postgresql-server-dev-10 libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-private-dev libpoppler-glib-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libqt4-dev libqtwebkit-dev libqt4-opengl-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-2.6-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev qtwebengine5-dev libwebkit2gtk-4.0-dev
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libzstd-dev libmysqlclient-dev unixodbc-dev libpq-dev libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-private-dev libpoppler-glib-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libqt4-dev libqtwebkit-dev libqt4-opengl-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-2.6-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev qtwebengine5-dev libwebkit2gtk-4.0-dev
script:
- ./reconf-all
@ -182,7 +182,7 @@ build:ubuntu-xenial:
image: ubuntu:xenial
before_script:
- >
apt-get update && apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libmysqlclient-dev unixodbc-dev libpq-dev postgresql-server-dev-9.5 libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev libpoppler-private-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libqt4-dev libqtwebkit-dev libqt4-opengl-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgnome-keyring-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-2.6-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev libwebkit2gtk-3.0-dev
apt-get update && apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libmysqlclient-dev unixodbc-dev libpq-dev libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev libpoppler-private-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libqt4-dev libqtwebkit-dev libqt4-opengl-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgnome-keyring-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl-dev libncurses5-dev libgmime-2.6-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev libqt5opengl5-dev libqt5svg5-dev libqt5webkit5-dev libqt5x11extras5-dev qtbase5-dev libwebkit2gtk-3.0-dev
script:
- ./reconf-all
@ -194,7 +194,7 @@ build:ubuntu-trusty:
image: ubuntu:trusty
before_script:
- >
apt-get update && apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libmysqlclient-dev unixodbc-dev libpq-dev postgresql-server-dev-9.3 libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev libpoppler-private-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libqt4-dev libqtwebkit-dev libqt4-opengl-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgnome-keyring-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl0-dev libncurses5-dev libgmime-2.6-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev git libglu1-mesa-dev libglu1-mesa-dev libglew1.10 libglu1-mesa libgles2-mesa-dev libwebkit2gtk-3.0-dev
apt-get update && apt-get install -y build-essential g++ automake autoconf libtool libbz2-dev libmysqlclient-dev unixodbc-dev libpq-dev libsqlite0-dev libsqlite3-dev libglib2.0-dev libgtk2.0-dev libcurl4-gnutls-dev libgtkglext1-dev libpcre3-dev libsdl-sound1.2-dev libsdl-mixer1.2-dev libsdl-image1.2-dev libxml2-dev libxslt1-dev librsvg2-dev libpoppler-dev libpoppler-glib-dev libpoppler-private-dev libpoppler-cpp-dev libasound2-dev libdirectfb-dev libxtst-dev libffi-dev libqt4-dev libqtwebkit-dev libqt4-opengl-dev libglew-dev libimlib2-dev libv4l-dev libsdl-ttf2.0-dev libgnome-keyring-dev libgdk-pixbuf2.0-dev linux-libc-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libcairo2-dev libgsl0-dev libncurses5-dev libgmime-2.6-dev llvm-dev llvm libalure-dev libgmp-dev libgtk-3-dev libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev sane-utils libdumb1-dev libssl-dev git libglu1-mesa-dev libglu1-mesa-dev libglew1.10 libglu1-mesa libgles2-mesa-dev libwebkit2gtk-3.0-dev
script:
- ./reconf-all
@ -224,7 +224,7 @@ build:fedora-latest:
image: fedora:latest
before_script:
- >
dnf install -y libtool libtool-ltdl-devel gcc make autoconf dumb-devel gmime-devel gmime30-devel libffi-devel mariadb-devel postgresql-devel unixODBC-devel sqlite2-devel libsqlite3x-devel libxslt-devel libv4l-devel glew-devel poppler-devel poppler-glib-devel poppler-cpp-devel qt-devel qt5-qtbase-devel qt5-qtbase-private-devel qt5-qtwebengine-devel qt5-qtx11extras-devel qt5-qtsvg-devel SDL_ttf-devel SDL_mixer-devel SDL-devel SDL2_ttf-devel SDL2_mixer-devel SDL2_image-devel SDL2-devel cairo-devel gtk2-devel gtk3-devel imlib2-devel librsvg2-devel qt-webkit-devel qt5-qtwebkit qt5-qtwebkit-devel openal-soft-devel libjpeg-turbo-devel gtkglext-devel gmp-devel libxml2-devel libXtst-devel gsl-devel pcre-devel dbus-devel libcurl-devel alure-devel gstreamermm-devel libgnome-keyring-devel bzip2-devel libzstd-devel postgresql-server-devel webkit2gtk3-devel ncurses-devel
dnf install -y libtool libtool-ltdl-devel gcc make autoconf dumb-devel gmime-devel gmime30-devel libffi-devel mariadb-devel postgresql-devel unixODBC-devel sqlite2-devel libsqlite3x-devel libxslt-devel libv4l-devel glew-devel poppler-devel poppler-glib-devel poppler-cpp-devel qt-devel qt5-qtbase-devel qt5-qtbase-private-devel qt5-qtwebengine-devel qt5-qtx11extras-devel qt5-qtsvg-devel SDL_ttf-devel SDL_mixer-devel SDL-devel SDL2_ttf-devel SDL2_mixer-devel SDL2_image-devel SDL2-devel cairo-devel gtk2-devel gtk3-devel imlib2-devel librsvg2-devel qt-webkit-devel qt5-qtwebkit qt5-qtwebkit-devel openal-soft-devel libjpeg-turbo-devel gtkglext-devel gmp-devel libxml2-devel libXtst-devel gsl-devel pcre-devel dbus-devel libcurl-devel alure-devel gstreamermm-devel libgnome-keyring-devel bzip2-devel libzstd-devel webkit2gtk3-devel ncurses-devel
script:
- ./reconf-all
- GAMBAS_CONFIG_FAILURE=1 ./configure -C
@ -235,7 +235,7 @@ build:opensuse-tumbleweed:
image: opensuse/tumbleweed
before_script:
- >
zypper update -y && zypper install -y libtool gcc glew-devel gmime-devel gtk2-devel gtk3-devel libqt5-qtx11extras-devel libqt5-qtwebengine-devel libQt5Xml-devel libQt5Sql-devel libqt5-qtsvg-devel libQt5Gui-devel libQt5Core-devel libQt5Sql5-postgresql libQt5Sql5-unixODBC libQt5Sql5-mysql libQt5Sql5-sqlite webkit2gtk3-devel libICE-devel libSM-devel unixODBC-devel libzip-devel libzstd-devel libmariadb-devel gsl-devel libopenssl-devel alure-devel postgresql-devel postgresql-server-devel libcurl-devel libSDL_ttf-devel libSDL_mixer-devel libSDL-devel libSDL2_ttf-devel libSDL2_mixer-devel libSDL2_image-devel libSDL2-devel libxslt-devel libv4l-devel librsvg-devel gtkglext-devel libgnome-keyring-devel libjpeg62-devel libpoppler-devel libpoppler-glib-devel imlib2-devel gmp-devel gstreamermm-devel
zypper update -y && zypper install -y libtool gcc glew-devel gmime-devel gtk2-devel gtk3-devel libqt5-qtx11extras-devel libqt5-qtwebengine-devel libQt5Xml-devel libQt5Sql-devel libqt5-qtsvg-devel libQt5Gui-devel libQt5Core-devel libQt5Sql5-postgresql libQt5Sql5-unixODBC libQt5Sql5-mysql libQt5Sql5-sqlite webkit2gtk3-devel libICE-devel libSM-devel unixODBC-devel libzip-devel libzstd-devel libmariadb-devel gsl-devel libopenssl-devel alure-devel postgresql-devel libcurl-devel libSDL_ttf-devel libSDL_mixer-devel libSDL-devel libSDL2_ttf-devel libSDL2_mixer-devel libSDL2_image-devel libSDL2-devel libxslt-devel libv4l-devel librsvg-devel gtkglext-devel libgnome-keyring-devel libjpeg62-devel libpoppler-devel libpoppler-glib-devel imlib2-devel gmp-devel gstreamermm-devel
script:
- ./reconf-all
- GAMBAS_CONFIG_FAILURE=1 ./configure -C --disable-qt4 --disable-sqlite2 --disable-qt5webkit

View file

@ -13,7 +13,7 @@ dnl ---- PostgreSQL driver
GB_COMPONENT(
postgresql, POSTGRESQL, gb.db.postgresql, [src],
[GB_FIND(libpq-fe.h postgres.h pg_type.h, $prefix /usr/local/lib /usr/local /opt /usr/lib /usr, include/pgsql* pgsql*/include include/postgresql* postgresql*/include include/postgresql/*/server/catalog include/postgresql/*/server include)],
[GB_FIND(libpq-fe.h, $prefix /usr/local/lib /usr/local /opt /usr/lib /usr, include/pgsql* pgsql*/include include/postgresql* postgresql*/include include)],
[GB_FIND(libpq.$SHLIBEXT, $prefix /usr/local /opt /usr, lib pgsql*/lib postgresql*/lib)],
[$C_LIB -lpq])

View file

@ -40,8 +40,6 @@
#define __MAIN_C
#include <libpq-fe.h>
#include <postgres.h>
#include <pg_type.h>
#ifdef fprintf
#undef fprintf
@ -83,6 +81,22 @@ static DB_DRIVER _driver;
static int _last_error;
/*static int _print_query = FALSE;*/
// PostgreSQL datatypes
enum { OID_BOOL, OID_INT2, OID_INT4, OID_INT8, OID_NUMERIC, OID_FLOAT4, OID_FLOAT8, OID_ABSTIME,
OID_RELTIME, OID_DATE, OID_TIME, OID_TIMESTAMP, OID_DATETIME, OID_TIMESTAMPTZ, OID_BYTEA, OID_CHAR,
OID_BPCHAR, OID_VARCHAR, OID_TEXT, OID_NAME, OID_CASH,
OID_COUNT };
const char *_oid_names[] = {
"bool", "int2", "int4", "int8", "numeric", "float4", "float8", "abstime",
"reltime", "date", "time", "timestamp", "datetime", "timestamptz", "bytea", "char",
"bpchar", "varchar", "text", "name", "cash", NULL
};
int _oid[OID_COUNT] = { 0 };
// Get the SQL expression returning the default value of a field
static const char *get_default_value(const char *old_way)
@ -348,51 +362,27 @@ static int unquote_blob(const char *data, int len, DB_FORMAT_CALLBACK add)
static GB_TYPE conv_type(Oid type)
{
switch(type)
{
case BOOLOID:
return GB_T_BOOLEAN;
if (type == _oid[OID_BOOL])
return GB_T_BOOLEAN;
if (type == _oid[OID_INT2] || type == _oid[OID_INT4])
return GB_T_INTEGER;
case INT2OID:
case INT4OID:
return GB_T_INTEGER;
if (type == _oid[OID_INT8])
return GB_T_LONG;
case INT8OID:
return GB_T_LONG;
case NUMERICOID:
case FLOAT4OID:
case FLOAT8OID:
if (type == _oid[OID_NUMERIC] || type == _oid[OID_FLOAT4] || type == _oid[OID_FLOAT8])
return GB_T_FLOAT;
#ifdef ABSTIMEOID
case ABSTIMEOID:
case RELTIMEOID:
#endif
case DATEOID:
case TIMEOID:
case TIMESTAMPOID:
#ifdef DATETIMEOID
case DATETIMEOID:
#endif
#ifdef TIMESTAMPTZOID
case TIMESTAMPTZOID:
#endif
return GB_T_DATE;
if (type == _oid[OID_ABSTIME] || type == _oid[OID_RELTIME] || type == _oid[OID_DATE]
|| type == _oid[OID_TIME] || type == _oid[OID_TIMESTAMP] || type == _oid[OID_DATETIME]
|| type == _oid[OID_TIMESTAMPTZ])
return GB_T_DATE;
case BYTEAOID:
return DB_T_BLOB;
if (type == _oid[OID_BYTEA])
return DB_T_BLOB;
case CHAROID:
case BPCHAROID:
case VARCHAROID:
case TEXTOID:
case NAMEOID:
case CASHOID:
default:
return GB_T_STRING;
}
return GB_T_STRING;
}
@ -412,134 +402,85 @@ static void conv_data(const char *data, int len, GB_VARIANT_VALUE *val, Oid type
double sec;
bool bc;
switch (type)
if (type == _oid[OID_BOOL])
{
case BOOLOID:
val->type = GB_T_BOOLEAN;
val->value._boolean = conv_boolean(data) ? -1 : 0;
break;
case INT2OID:
case INT4OID:
GB.NumberFromString(GB_NB_READ_INTEGER, data, strlen(data), &conv);
val->type = GB_T_INTEGER;
val->value._integer = conv._integer.value;
break;
case INT8OID:
GB.NumberFromString(GB_NB_READ_LONG, data, strlen(data), &conv);
val->type = GB_T_LONG;
val->value._long = conv._long.value;
break;
case NUMERICOID:
case FLOAT4OID:
case FLOAT8OID:
GB.NumberFromString(GB_NB_READ_FLOAT, data, strlen(data), &conv);
val->type = GB_T_FLOAT;
val->value._float = conv._float.value;
break;
#ifdef ABSTIMEOID
case ABSTIMEOID:
case RELTIMEOID:
#endif
case DATEOID:
case TIMEOID:
case TIMESTAMPOID:
#ifdef DATETIMEOID
case DATETIMEOID:
#endif
#ifdef TIMESTAMPTZOID
case TIMESTAMPTZOID:
#endif
memset(&date, 0, sizeof(date));
if (len > 3 && strcmp(&data[len - 2], "BC") == 0)
bc = TRUE;
else
bc = FALSE;
switch(type)
{
#ifdef ABSTIMEOID
case ABSTIMEOID:
case RELTIMEOID:
#endif
case DATEOID:
sscanf(data, "%4d-%2d-%2d", &date.year, &date.month, &date.day);
break;
case TIMEOID:
sscanf(data, "%2d:%2d:%lf", &date.hour, &date.min, &sec);
date.sec = (short)sec;
date.msec = (short)((sec - date.sec) * 1000 + 0.5);
break;
case TIMESTAMPOID:
#ifdef DATETIMEOID
case DATETIMEOID:
#endif
#ifdef TIMESTAMPTZOID
case TIMESTAMPTZOID:
#endif
sscanf(data, "%4d-%2d-%2d %2d:%2d:%lf", &date.year, &date.month, &date.day, &date.hour, &date.min, &sec);
date.sec = (short)sec;
date.msec = (short)((sec - date.sec) * 1000 + 0.5);
break;
}
if (bc)
date.year = (-date.year);
// 4713-01-01 BC is used for null dates
if (date.year == -4713 && date.month == 1 && date.day == 1)
date.year = date.month = date.day = 0;
GB.MakeDate(&date, (GB_DATE *)&conv);
val->type = GB_T_DATE;
val->value._date.date = conv._date.value.date;
val->value._date.time = conv._date.value.time;
break;
case BYTEAOID:
// The BLOB are read by the blob_read() driver function
// You must set NULL there.
val->type = GB_T_NULL;
break;
case CHAROID:
case BPCHAROID:
case VARCHAROID:
case TEXTOID:
case NAMEOID:
case CASHOID:
default:
val->type = GB_T_CSTRING;
val->value._string = (char *)data;
//val->_string.len = len;
break;
val->type = GB_T_BOOLEAN;
val->value._boolean = conv_boolean(data) ? -1 : 0;
}
else if (type == _oid[OID_INT2] && type == _oid[OID_INT4])
{
GB.NumberFromString(GB_NB_READ_INTEGER, data, strlen(data), &conv);
val->type = GB_T_INTEGER;
val->value._integer = conv._integer.value;
}
else if (type == _oid[OID_INT8])
{
GB.NumberFromString(GB_NB_READ_LONG, data, strlen(data), &conv);
val->type = GB_T_LONG;
val->value._long = conv._long.value;
}
else if (type == _oid[OID_NUMERIC] || type == _oid[OID_FLOAT4] || type == _oid[OID_FLOAT8])
{
GB.NumberFromString(GB_NB_READ_FLOAT, data, strlen(data), &conv);
val->type = GB_T_FLOAT;
val->value._float = conv._float.value;
}
else if (type == _oid[OID_ABSTIME] || type == _oid[OID_RELTIME] || type == _oid[OID_DATE]
|| type == _oid[OID_TIME] || type == _oid[OID_TIMESTAMP] || type == _oid[OID_DATETIME]
|| type == _oid[OID_TIMESTAMPTZ])
{
memset(&date, 0, sizeof(date));
if (len > 3 && strcmp(&data[len - 2], "BC") == 0)
bc = TRUE;
else
bc = FALSE;
if (type == _oid[OID_ABSTIME] || type == _oid[OID_RELTIME] || type == _oid[OID_DATE])
{
sscanf(data, "%4d-%2d-%2d", &date.year, &date.month, &date.day);
}
else if (type == _oid[OID_TIME])
{
sscanf(data, "%2d:%2d:%lf", &date.hour, &date.min, &sec);
date.sec = (short)sec;
date.msec = (short)((sec - date.sec) * 1000 + 0.5);
}
else
{
sscanf(data, "%4d-%2d-%2d %2d:%2d:%lf", &date.year, &date.month, &date.day, &date.hour, &date.min, &sec);
date.sec = (short)sec;
date.msec = (short)((sec - date.sec) * 1000 + 0.5);
}
if (bc)
date.year = (-date.year);
// 4713-01-01 BC is used for null dates
if (date.year == -4713 && date.month == 1 && date.day == 1)
date.year = date.month = date.day = 0;
GB.MakeDate(&date, (GB_DATE *)&conv);
val->type = GB_T_DATE;
val->value._date.date = conv._date.value.date;
val->value._date.time = conv._date.value.time;
}
else if (type == _oid[OID_BYTEA])
{
// The BLOB are read by the blob_read() driver function
// You must set NULL there.
val->type = GB_T_NULL;
}
else
{
val->type = GB_T_CSTRING;
val->value._string = (char *)data;
}
}
@ -587,7 +528,7 @@ static int do_query(DB_DATABASE *db, const char *error, PGresult **pres, const c
else
query = qtemp;
DB.Debug("gb.db.postgresql", "%p: %s", conn, query);
DB.Debug("gb.db.postgresql", "%p: %s", db, query);
res = PQexec(conn, query);
ret = check_result(res, error);
@ -707,6 +648,31 @@ static void fill_field_info(DB_DATABASE *db, DB_FIELD *info, PGresult *res, int
info->collation = GB.NewZeroString(PQgetvalue(res, row, col + 5));
}
// Load datatypes
static bool init_datatypes(DB_DATABASE *db)
{
const char *oid;
const char *query = "select oid from pg_type where typname = '&1'";
PGresult *res;
int i;
for(i = 0;; i++)
{
oid = _oid_names[i];
if (!oid)
break;
if (do_query(db, "Unable to initialize datatypes", &res, query, 1, oid))
return TRUE;
if (PQntuples(res) == 1)
_oid[i] = atoi(PQgetvalue(res, 0, 0));
DB.Debug("gb.db.postgresql", "%p: --> %d", db, _oid[i]);
PQclear(res);
}
return FALSE;
}
/*****************************************************************************
@ -807,6 +773,14 @@ static int open_database(DB_DESC *desc, DB_DATABASE *db)
}
}
// datatypes
if (init_datatypes(db))
{
PQfinish(conn);
return TRUE;
}
/* flags */
db->flags.no_table_type = TRUE;
@ -827,7 +801,7 @@ static int open_database(DB_DESC *desc, DB_DATABASE *db)
}
else
db->charset = NULL;
return FALSE;
}