pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dave Johansen <davejohansen@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Updating .so files for functions?
Date: Sat, 14 Feb 2015 11:33:05 -0500
Message-ID: <28304.1423931585@sss.pgh.pa.us> (raw)
In-Reply-To: <CAAcYxUfWrREyARirfN2K5RqhDyVe8jT3hOb7fD_giuWdkxNcrQ@mail.gmail.com>
References: <CAAcYxUfWrREyARirfN2K5RqhDyVe8jT3hOb7fD_giuWdkxNcrQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

Dave Johansen <davejohansen@gmail.com> 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....
> ), 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 <db_name> 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



view thread (3+ messages)  latest in thread

Message-ID: <28304.1423931585@sss.pgh.pa.us>
Permalink:  ../28304.1423931585@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28304.1423931585@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, davejohansen@gmail.com
  Subject: Re: Updating .so files for functions?
  In-Reply-To: <28304.1423931585@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox