Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YMfeb-0002Vv-Mu for pgsql-admin@arkaria.postgresql.org; Sat, 14 Feb 2015 16:33:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YMfea-0001oW-Va for pgsql-admin@arkaria.postgresql.org; Sat, 14 Feb 2015 16:33:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YMfeZ-0001oP-TT for pgsql-admin@postgresql.org; Sat, 14 Feb 2015 16:33:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YMfeW-0000qY-MU for pgsql-admin@postgresql.org; Sat, 14 Feb 2015 16:33:10 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t1EGX5d2028305; Sat, 14 Feb 2015 11:33:05 -0500 From: Tom Lane To: Dave Johansen cc: pgsql-admin@postgresql.org Subject: Re: Updating .so files for functions? In-reply-to: References: Comments: In-reply-to Dave Johansen message dated "Fri, 13 Feb 2015 15:58:17 -0700" Date: Sat, 14 Feb 2015 11:33:05 -0500 Message-ID: <28304.1423931585@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Dave Johansen writes: > I ran into a crash that was caused by the .so files used by postgres being > overwritten ( see > http://www.postgresql.org/message-id/CAAcYxUeduPhKXbDQ6ZTOhKGE+1A3cMrTQujSExC-tv4ac4ksUw@mail.gmail.com > ), so that made me wonder what the rules are for updating .so files. I read > through the documentation on C functions ( > http://www.postgresql.org/docs/8.4/static/xfunc-c.html ) but didn't come to > any firm answers. > Here's our current procedure: > 1) Build new .so files > 2) Put new .so files in "version directory" (for example > /path/to/funcs/1.23.1/ where old version was /path/to/funcs/1.23.0/) > 3) Run "ALTER DATABASE SET dynamic_library_path TO > '/path/to/funcs/1.23.1:$libdir';" > Is that an ok operation to perform on a live database? Will existing > connections handle that without issues? (I'm ok if they still keep using > the old .so files until the connection is closed and re-opened) That should be safe enough, I'd think (noting that already-launched sessions would keep using the old libraries, since ALTER DATABASE settings are only adopted at session start). What I'm wondering about is if someone made an ABI-incompatible change to one of the functions provided by the libraries, and adjusted their SQL declarations to match. Then you'd had problems with some sessions seeing new SQL declarations and old libraries. regards, tom lane -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin