[HACKERS] libpq parallel build
src/interfaces/libpq/fe-misc.c #include-s pg_config_paths.h, but in the makefile that dependency is not declared. This breaks the build with 'make -jN' (with a big N) ... sometimes (non-deterministically). Patch attached. Made from 9.1.1, but from browsing the git master on the web interface, the facts above seem to still be true. -- Lionel diff --recursive -u misc/build/postgresql-9.1.1/src/interfaces/libpq/Makefile misc/build/postgresql-9.1.1.patch/src/interfaces/libpq/Makefile --- misc/build/postgresql-9.1.1/src/interfaces/libpq/Makefile 2012-02-06 15:11:19.0 +0100 +++ misc/build/postgresql-9.1.1.patch/src/interfaces/libpq/Makefile 2012-02-06 15:02:51.0 +0100 @@ -109,6 +109,7 @@ libpq.rc: $(top_builddir)/src/Makefile.global fe-connect.o: fe-connect.c $(top_builddir)/src/port/pg_config_paths.h +fe-misc.o: fe-misc.c $(top_builddir)/src/port/pg_config_paths.h $(top_builddir)/src/port/pg_config_paths.h: $(MAKE) -C $(top_builddir)/src/port pg_config_paths.h -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] information schema/aclexplode doesn't know about default privileges
On Mon, Jan 09, 2012 at 08:23:59PM +0200, Peter Eisentraut wrote: On mån, 2012-01-02 at 06:43 +0200, Peter Eisentraut wrote: I figured the best and most flexible way to address this is to export acldefault() as an SQL function and replace aclexplode(proacl) with aclexplode(coalesce(proacl, acldefault('f', proowner))) Nobody had a better idea, so here is the final patch. Thanks! This is important for the LibreOffice-PostgreSQL integration, since LibreOffice uses the privilege information to determine whether to let the user edit/insert data in the UI or not. It is thus important for this information to be correct. I currently work around that with a UNION, assuming that the default acl is owner has all rights. -- Lionel -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] LibreOffice driver 1: Building libpq with Mozilla LDAP instead of OpenLDAP
On Tue, Dec 13, 2011 at 11:45:28AM +0100, Magnus Hagander wrote: On Tue, Dec 13, 2011 at 11:15, Lionel Elie Mamane lio...@mamane.lu wrote: LibreOffice can be configured at build-time to use Mozilla LDAP or OpenLDAP. We patched postgresql's configure.in to build libpq with Mozilla LDAP when requested to do so. I'd also be happy to extract from our patch the parts that are relevant for integration in postgresql proper, and massage them into the right modularity / form. Are you interested? Please do. The patch is attached. I got everybody that touched the patch in the LibreOffice git repo to agree to the PostgreSQL license for the patch. The changes to tools/msvc are untested since I don't personally have a Microsoft Windows build environment and LibreOffice uses src/interfaces/lipq/win32.mak to build libpq. The patch introduces a preprocessor macro USE_MICROSOFT_LDAP to enable the Microsoft LDAP part to replace the previously used #ifdef WIN32, since one can also use Mozilla LDAP on MS Windows. I found that cleaner than putting everywhere #if defined(WIN32) ! defined(USE_MOZLDAP). Except for that, the only change is to the config/build system proper, to recognise and use the Mozilla LDAP library. -- Lionel diff --recursive -u misc/build/postgresql-9.1.1/configure.in misc/build/postgresql-9.1.1.patched/configure.in --- misc/build/postgresql-9.1.1/configure.in 2011-09-22 23:57:57.0 +0200 +++ misc/build/postgresql-9.1.1.patched/configure.in 2011-12-14 13:10:11.0 +0100 @@ -662,6 +662,13 @@ AC_MSG_RESULT([$with_ldap]) AC_SUBST(with_ldap) +AC_MSG_CHECKING([whether to use Mozilla C SDK for LDAP support]) +PGAC_ARG_BOOL(with, mozldap, no, + [build with Mozilla LDAP support], + [AC_DEFINE([USE_MOZLDAP], 1, [Define to 1 to use the Mozilla LDAP C SDK instead of platform default (OpenLDAP or Microsoft LDAP). (--with-mozldap)])]) +AC_MSG_RESULT([$with_mozldap]) +AC_SUBST(with_mozldap) + # # Bonjour @@ -1077,7 +1084,7 @@ fi if test $with_ldap = yes ; then - if test $PORTNAME != win32; then + if test $PORTNAME != win32 || test $with_mozldap = yes; then AC_CHECK_HEADERS(ldap.h, [], [AC_MSG_ERROR([header file ldap.h is required for LDAP])]) else @@ -1086,6 +1093,7 @@ [AC_INCLUDES_DEFAULT #include windows.h ]) + AC_DEFINE([USE_MICROSOFT_LDAP], 1, [Defined when using Microsof LDAP]) fi fi @@ -1498,7 +1506,18 @@ # We can test for libldap_r only after we know PTHREAD_LIBS if test $with_ldap = yes ; then _LIBS=$LIBS - if test $PORTNAME != win32; then + if test $with_mozldap = yes; then +if test $PORTNAME != win32; then + mozlibname=ldap50 +else + mozlibname=nsldap32v50 +fi +AC_CHECK_LIB($mozlibname, ldap_bind, [], + [AC_MSG_ERROR([library $mozlibname is required for Mozilla LDAP])], + [$PTHREAD_CFLAGS $PTHREAD_LIBS $EXTRA_LDAP_LIBS]) +LDAP_LIBS_FE=-l$mozlibname $EXTRA_LDAP_LIBS +LDAP_LIBS_BE=-l$mozlibname $EXTRA_LDAP_LIBS + elif test $PORTNAME != win32; then AC_CHECK_LIB(ldap, ldap_bind, [], [AC_MSG_ERROR([library 'ldap' is required for LDAP])], [$EXTRA_LDAP_LIBS]) diff --recursive -u misc/build/postgresql-9.1.1/src/backend/libpq/auth.c misc/build/postgresql-9.1.1.patched/src/backend/libpq/auth.c --- misc/build/postgresql-9.1.1/src/backend/libpq/auth.c 2011-09-22 23:57:57.0 +0200 +++ misc/build/postgresql-9.1.1.patched/src/backend/libpq/auth.c 2011-12-14 13:10:11.0 +0100 @@ -93,11 +93,7 @@ * */ #ifdef USE_LDAP -#ifndef WIN32 -/* We use a deprecated function to keep the codepath the same as win32. */ -#define LDAP_DEPRECATED 1 -#include ldap.h -#else +#ifdef USE_MICROSOFT_LDAP #include winldap.h /* Correct header from the Platform SDK */ @@ -109,6 +105,10 @@ IN PLDAPControlA * ServerControls, IN PLDAPControlA * ClientControls ); +#else +/* We use a deprecated function to keep the codepath the same as win32. */ +#define LDAP_DEPRECATED 1 +#include ldap.h #endif static int CheckLDAPAuth(Port *port); @@ -2043,7 +2043,7 @@ *ldap = ldap_init(port-hba-ldapserver, port-hba-ldapport); if (!*ldap) { -#ifndef WIN32 +#ifndef USE_MICROSOFT_LDAP ereport(LOG, (errmsg(could not initialize LDAP: error code %d, errno))); @@ -2065,7 +2065,7 @@ if (port-hba-ldaptls) { -#ifndef WIN32 +#ifndef USE_MICROSOFT_LDAP if ((r = ldap_start_tls_s(*ldap, NULL, NULL)) != LDAP_SUCCESS) #else static __ldap_start_tls_sA _ldap_start_tls_sA = NULL; diff --recursive -u misc/build/postgresql-9.1.1/src/interfaces/libpq/fe-connect.c misc/build/postgresql-9.1.1.patched/src/interfaces/libpq/fe-connect.c --- misc/build/postgresql-9.1.1/src/interfaces/libpq/fe-connect.c 2011-09-22 23:57:57.0 +0200 +++ misc/build/postgresql-9.1.1.patched/src/interfaces/libpq/fe-connect.c 2011-12-14 13:10
Re: [HACKERS] LibreOffice driver 1: Building libpq with Mozilla LDAP instead of OpenLDAP
On Wed, Dec 14, 2011 at 10:05:26AM -0500, Tom Lane wrote: Pavel Golub pa...@microolap.com writes: You wrote: TL about OSX though. (You're aware that Apple ships a perfectly fine TL libpq.so in Lion, no?) I've not made an attempt to use it directly myself, but it sure looks like it should do what the OP wants. Yes, it looks like that, except for being available on older MacOS X; LibreOffice wished to stay compatible with 10.4. -- Lionel -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] LibreOffice driver 2: MIT Kerberos vs Microsoft Kerberos
On Tue, Dec 13, 2011 at 05:09:01PM -0500, Stephen Frost wrote: * Greg Smith (g...@2ndquadrant.com) wrote: Given that pgAdmin III has given up on MIT KRB5, would you feel doing the same is appropriate for LibreOffice too? Yes, I'd encourage LibreOffice to drop MIT Kerberos for Windows from their configure/install of libpq on Windows. Thanks for the advice, we won't enable it. -- Lionel -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
[HACKERS] LibreOffice driver 1: Building libpq with Mozilla LDAP instead of OpenLDAP
Hi, I've revived the old moribund / bitrotten OpenOffice driver for PostgreSQL (originally at http://dba.openoffice.org/drivers/postgresql/index.html). As you may already know, OpenOffice was forked into LibreOffice. Barring any unforeseen disaster, LibreOffice 3.5 (to be released in early February 2011) will bundle that driver. As part of this integration, I have a few questions / remarks. LibreOffice can be configured at build-time to use Mozilla LDAP or OpenLDAP. We patched postgresql's configure.in to build libpq with Mozilla LDAP when requested to do so. I wanted to check that this is not by any chance known to produce a more-or-less subtly broken libpq. I'd also be happy to extract from our patch the parts that are relevant for integration in postgresql proper, and massage them into the right modularity / form. Are you interested? -- Lionel -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
[HACKERS] LibreOffice driver 2: MIT Kerberos vs Microsoft Kerberos
(See part 1 for general introduction) LibreOffice currently - when it rebuilds libpq, such as for our official MS Windows binaries - links libpq against only the MS Windows built-in SSPI stuff, which if I understand well is an embrace and extend Kerberos 5 implementation. I wanted to understand the limitations (if any) of building libpq on Windows only with the MS Windows-builtin Kerberos and not additionally with MIT Kerberos. The gsslib parameter in the connection string won't work, but will that keep users from authenticating to some Kerberos domains, and/or are there other (interoperability?) issues that make it strongly desirable to link libpq with *both* SSPI *and* MIT krb5 (and its gssapi_krb5 library)? -- Lionel -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
[HACKERS] LibreOffice driver 3: pg_config and linking statically to libpq
(See part 1 for general introduction) LibreOffice currently - when it rebuilds libpq, such as for most of our official binaries - links statically against libpq. I noticed that pg_config does not give the information of what additional libraries to include in the link to resolve all symbols that libpq needs: * On the one hand, it gives too much since LIBS is filtered to only a subset in src/interface/libpq/Makefile. * On the other hand, it does not give enough, since it does not give the value of LDAP_LIBS_FE anywhere, nor say if it is necessary to add PTHREAD_LIBS. This is not an immediate problem for LibreOffice: I export the value of SHLIB_EXPORTS from src/interface/libpq/Makefile as a Makefile snippet that gets imported in our build system or (on Microsoft Windows) we just proceeded by trial and error until the link succeeds. However, I suggest it would be cleaner to give that kind of information in pg_config, so that one can basically do something like: $LINK_COMMAND -lpq $(pg_config --libpq-dep-libs) and have it work automatically. You could also provide a pq.pc file for pkgconfig, which would give nice nearly-automatic integration for projects using e.g. autoconf and friends. -- Lionel -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] LibreOffice driver 1: Building libpq with Mozilla LDAP instead of OpenLDAP
On Tue, Dec 13, 2011 at 10:43:26AM -0500, Tom Lane wrote: Lionel Elie Mamane lio...@mamane.lu writes: LibreOffice can be configured at build-time to use Mozilla LDAP or OpenLDAP. We patched postgresql's configure.in to build libpq with Mozilla LDAP when requested to do so. Um, if I interpret this correctly, you're intending to make OpenOffice include a bundled copy of libpq.so. With my other hat on (the red fedora) that sounds like a truly awful idea. In the traditional Unix world (GNU/Linux, Free/Net/Open/MirBSD, ...), libpq.so.5 is in the dynamic linker's default search path, so we can conceivably link against it and tell ours users install package libpq5 / postgresql-client-lib / ... if you want PostgreSQL support. On MacOS X and Microsoft Windows, the world is far more messy. There are several ways to install libpq (one-click installer, fink, MacPorts, ...), and each of these ways allows the user to select an install location (or a prefix thereof) freely. How we are supposed to instruct the dynamic linker to find libpq on the user's system, you tell me, I have no better idea than bundling it (or linking statically); running find / -name libpq.5.dylib (or libpq.dll on Windows) and then dynamically running otool (the MacOS X equivalent of chrpath/patchelf/...) on ourselves is *not* practical, to say the least... Distros do not like packages that include bundled copies of other packages' libraries, Traditional Unix distros are free to (and I expect typically will) configure LibreOffice with --with-system-libs or --with-system-postgresql (which will use pg_config in the PATH) or --with-libpq-path=/foo/bar, all of which will just link against libpq and not bundle it, and expect to find it at runtime at the same location than at compile-time or in the dynamic linker's default search path. Their RPM/DEB/... will declare a dependency on the RPM/DEB/... that ships an ABI-compatible libpq.so.5, so it will be there and all will be well. With my Debian GNU/{Linux,kFreeBSD,Hurd,...} hat on, obviously I would not have it any other way. With my LibreOffice hat on, I have to take care of other platforms' needs, too. because they're a nightmare for updates (cf recent discussions about static libraries, which are the same thing). I strongly suggest you find a way to not need to do this. Personally, I don't have a beginning of a clue of a way to not need to do this for MacOS X and Microsoft Windows. The MacOS X Windows guys within LibreOffice tell me bundling the lib (or linking statically) is the least insane thing to do on these platforms. shrug -- Lionel -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] LibreOffice driver 1: Building libpq with Mozilla LDAP instead of OpenLDAP
On Tue, Dec 13, 2011 at 12:48:01PM -0500, Tom Lane wrote: Greg Smith g...@2ndquadrant.com writes: On 12/13/2011 11:07 AM, Lionel Elie Mamane wrote: On MacOS X and Microsoft Windows, the world is far more messy. There are several ways to install libpq (one-click installer, fink, MacPorts, ...), and each of these ways allows the user to select an install location (or a prefix thereof) freely. This is less controversial. Yeah, I'm aware that sane handling of library dependencies is practically impossible under Windows, (...). I wasn't thinking about OSX though. (You're aware that Apple ships a perfectly fine libpq.so in Lion, no?) No, I was not aware of that. Thank you for that information. Is it installed by default? Anyway, LibreOffice wishes to be compatible back to MacOS X 10.4 (probably to have some sort of MacOSX/PowerPC support), so that's not yet useful to us, but it is good news! As I use PQconnectdbParams, I also need version 9.0 or later (but I'd be willing to work around that if it were useful). -- Lionel -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers