eulerto / pgquarrel

pgquarrel compares PostgreSQL database schemas (DDL)
BSD 3-Clause "New" or "Revised" License
389 stars 42 forks source link

PostgreSQL 12 support #82

Closed devrimgunduz closed 4 years ago

devrimgunduz commented 4 years ago

Hi,

Getting this error below while building 0.6.0 against PostgreSQL 12:

/usr/bin/ld: CMakeFiles/pgquarrel.dir/src/common.c.o: in function formatObjectIdentifier': .pgquarrel-pgquarrel_0_6_0/src/common.c:198: undefined reference toNumScanKeywords'

Can you please take a look?

Thanks!

Regards, Devrim

eulerto commented 4 years ago

@devrimgunduz it seems postgres detection module is broken. :(

[tests on CentOS 8...]

CMake postgres module can't assign the right variables. See:

$ export PATH=/usr/pgsql-12/bin:$PATH
$ cd pgquarrel/
$ rm -rf CMakeFiles/ CMakeCache.txt cmake_install.cmake Makefile
$ cmake -DCMAKE_INSTALL_PREFIX=/tmp/pgquarrel .
-- The C compiler identification is GNU 8.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
pg_config: /usr/pgsql-12/bin/pg_config
PostgreSQL FOUND: TRUE
LIBS: /usr/pgsql-12/lib/libpgport.a;/usr/pgsql-12/lib/libpgcommon.a
PostgreSQL LIBRARIES: /usr/pgsql-10/lib/libpq.so
PostgreSQL LIBRARY DIRS: /usr/pgsql-10/lib
PostgreSQL INCLUDE DIRS: /usr/pgsql-10/include;/usr/pgsql-10/include/server
-- Configuring done
-- Generating done
-- Build files have been written to: /home/centos/pgquarrel

However, if you inform CMAKE_PREFIX_PATH, it assigns the correct paths (because it does not use the cmake module).

$ cd pgquarrel/
$ rm -rf CMakeFiles/ CMakeCache.txt cmake_install.cmake Makefile
$ cmake -DCMAKE_INSTALL_PREFIX=/tmp/pgquarrel -DCMAKE_PREFIX_PATH=/usr/pgsql-12/bin .
-- The C compiler identification is GNU 8.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
pg_config: /usr/pgsql-12/bin/pg_config
PostgreSQL FOUND: 
LIBS: /usr/pgsql-12/lib/libpgport.a;/usr/pgsql-12/lib/libpgcommon.a
PostgreSQL LIBRARIES: /usr/pgsql-12/lib/libpq.so
PostgreSQL LIBRARY DIRS: /usr/pgsql-12/lib
PostgreSQL INCLUDE DIRS: /usr/pgsql-12/include;/usr/pgsql-12/include/server
-- Configuring done
-- Generating done
-- Build files have been written to: /home/centos/pgquarrel

I will try to figure out how to fix the cmake postgres detection module. Let me know if this workaround works for you.

eulerto commented 4 years ago

@devrimgunduz I committed some patches to improve the build process and I also add it to README. Could you try again?

devrimgunduz commented 4 years ago

Hi @eulerto ,

I can confirm that it works.

Thanks!

Cheers, Devrim