HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

is my postgresql-server thread-safe?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
postgresqlthreadsafeserver

Problem

before 9.0 i had to compile my postgresql-server with "--enable-thread-safety" for http://www.bacula.org

since 9.0 the config-paramater is renamed to "--disable-thread-safety".

The "PostgreSQL Development Group"-Package for CentOS 6.2 doesn't use this parameter.
http://yum.postgresql.org/9.1/redhat/rhel-6-i386/

# pg_config --configure
'--disable-rpath' '--prefix=/usr/pgsql-9.1' '--includedir=/usr/pgsql-9.1/include'
'--mandir=/usr/pgsql-9.1/share/man' '--datadir=/usr/pgsql-9.1/share' '--with-perl'
'--with-python' '--with-tcl' '--with-tclconfig=/usr/lib64' '--with-openssl' '--with-pam'
'--with-krb5' '--with-gssapi' '--with-includes=/usr/include' '--with-libraries=/usr/lib64'
'--enable-nls' '--with-ossp-uuid' '--with-libxml' '--with-libxslt' '--with-ldap'
'--with-system-tzdata=/usr/share/zoneinfo' '--sysconfdir=/etc/sysconfig/pgsql'
'--docdir=/usr/share/doc'
'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et'
'CPPFLAGS= -I/usr/include/et'


I don't know, how bacula is testing the thread-safety.
http://www.bacula.org/de/dev-manual/Installi_Configur_PostgreS.html#tex2html63

after yum install postgresql91-devel
i have the file libpq.a and the check is successful:

nm /usr/pgsql-9.1/lib/libpq.a | grep pthread_mutex_lock
  U pthread_mutex_lock
  U pthread_mutex_lock


how can i check, that my database-server is thread-safety?

Solution

The thread-safety parameter is only relevant for the client library libpq it doesn't influence how the backend is build. The backend actually doesn't even use threads, it uses a process per connection.

edit
just noticed I didn't address the renaming of the configure parameter. The point with configure is that the build scripts can support optional features. If you have a feature X you can pass either --enable-X or --disable-X. However it's help output will only list one of the two based on the current default (enabled is the default since 9.0 for thread-safety).

Context

StackExchange Database Administrators Q#19262, answer score: 3

Revisions (0)

No revisions yet.